BASS.NET API for the Un4seen BASS Audio LibraryWaveFormGetMarkerSec Method BASS.NET API for the Un4seen BASS Audio Library
Returns a given marker position.

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

public double GetMarkerSec(
	string name
)

Parameters

name
Type: SystemString
The name of the marker to get.

Return Value

Type: Double
The marker position in seconds or -1 if the marker name does not exist.
Remarks

This is the complementary method of AddMarker(String, Int64).

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) this method would return the position according to the rendering process, meaning the position would reflect a different value. In this case make sure to call SyncPlayback(Int32) before getting any markers. This will ensure that the position will be converted accordingly to the playback.

Examples

VB
Private WF As Un4seen.Bass.Misc.WaveForm = Nothing
...
 ' render a wave form
 WF = New WaveForm(_fileName, New WAVEFORMPROC(MyWaveFormCallback), Me)
 WF.FrameResolution = 0.01F ' 10ms are nice
 WF.CallbackFrequency = 500 ' every 5 seconds rendered (500*10ms=5sec)
 WF.DrawMarker = WaveForm.MARKERDRAWTYPE.Line Or 
                 WaveForm.MARKERDRAWTYPE.Name Or 
                 WaveForm.MARKERDRAWTYPE.NamePositionAlternate
 WF.RenderStart(False, BASSFlag.BASS_SAMPLE_FLOAT)
 ' from here on we might add markers...just examples here...
 WF.AddMarker("CueIn", 2.0)
 ...
 ' this will get the 'CueIn' marker
 Dim position As Double = WF.GetMarkerSec("CueIn")
private Un4seen.Bass.Misc.WaveForm WF = null;
...
// render a wave form
WF = new WaveForm(_fileName, new WAVEFORMPROC(MyWaveFormCallback), this);
WF.FrameResolution = 0.01f; // 10ms are nice
WF.CallbackFrequency = 500; // every 5 seconds rendered (500*10ms=5sec)
WF.DrawMarker = WaveForm.MARKERDRAWTYPE.Line | 
                WaveForm.MARKERDRAWTYPE.Name | 
                WaveForm.MARKERDRAWTYPE.NamePositionAlternate;
WF.RenderStart( false, BASSFlag.BASS_SAMPLE_FLOAT );
// from here on we might add markers...just examples here...
WF.AddMarker( "CueIn", 2.0 );
...
// this will get the 'CueIn' marker
double position = WF.GetMarkerSec( "CueIn" );
See Also

Reference