BASS.NET API for the Un4seen BASS Audio LibraryWaveFormAddVolumePoint Method (Int64, Single)BASS.NET API for the Un4seen BASS Audio Library
Add or replace a volume point to the WaveForm.

Namespace: Un4seen.Bass.Misc
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

public bool AddVolumePoint(
	long position,
	float level
)

Parameters

position
Type: SystemInt64
The position (in bytes) of the volume point (e.g. as returned by BASS_ChannelGetPosition(Int32, BASSMode)).
level
Type: SystemSingle
The volume level of the point to add or replace (0=silent, 1.0=maximum=0dB).

Return Value

Type: Boolean
, if the volume point was added or replaced successfully, else .
Remarks

Volume points might be used to draw a volume curve within a WaveForm.

Use the DrawVolume property to define if and how the volume curve should be drawn within the WaveForm. The ColorVolume property will be used as the the drawing color.

In order to remove a volume point use the RemoveVolumePoint(Int64) or ClearAllVolumePoints methods.

Before adding a volume point the Wave buffer must have been created. So make sure this method is only called after WaveFormLoadFromFile(String), RenderStartRecording(Int32, Int32, Int32) or RenderStart(Int32, Boolean).

Use the GetVolumePoint(Int64) method to retrive a certain volume point. Via GetVolumeLevel(Int64, Boolean, Int64, Single) you might retrieve the volume level of the curve at any point.

If your rendering method and your playback stream used different flags during creation (e.g. rendering was done using the BASS_DEFAULT flag whereas your playback stream uses BASS_SAMPLE_FLOAT) adding volume points might result in a different position, meaning the position would reflect a different value during playback. In such case call the SyncPlayback(Int32) method to ensure, that the position will be converted accordingly.

Note: The byte position will be converted to the original rendering resolution according the SyncPlayback(Int32). So if your playback stream has a different resolution never add volume points without first calling SyncPlayback(Int32).

See Also

Reference