Hey everybody :-)
I have an issue with BASS_ATTRIB_TEMPO when I start playback of the same song repeatedly. I get ErrorCode 0 on the call, but the music will only be playing with normal speed, as if I set BASS_ATTRIB_TEMPO to 0. The value seems to be valid. So when I play the song, then set the tempo, and then call PlayBeat_Execute again, the song plays as if Tempo was 0.
When I change the value while the song is playing, it works all fine...
Here is my code:
Private _Tempo As Single
Public Property Tempo As Single
Get
Return _Tempo
End Get
Set(value As Single)
_Tempo = CSng(Math.Round(value, 0)) 'round to 0 decimal places
Bass.BASS_ChannelSetAttribute(streamfx, BASSAttribute.BASS_ATTRIB_TEMPO, _Tempo)
RaisePropertyChanged()
End Set
End Property
Private Sub PlayBeat_Execute(obj As Object)
Bass.BASS_ChannelStop(streamfx)
Bass.BASS_StreamFree(streamfx)
Bass.BASS_StreamFree(stream)
WF = New WaveForm(SelektierterBeat.DateiName, New Un4seen.Bass.Misc.WAVEFORMPROC(AddressOf MeineWaveFormCallback), Nothing)
InitialisiereWF() 'initialize waveform
WF.RenderStart(True, Nothing)
stream = Bass.BASS_StreamCreateFile(SelectedBeat.FileName, 0, 0, BASSFlag.BASS_SAMPLE_LOOP Or BASSFlag.BASS_STREAM_DECODE)
streamfx = BassFx.BASS_FX_TempoCreate(stream, Nothing)
Bass.BASS_ChannelSetAttribute(streamfx, BASSAttribute.BASS_ATTRIB_TEMPO, Tempo)
MessageBox.Show("Tempo: " & Tempo.ToString & " " & Bass.BASS_ErrorGetCode.ToString)
Bass.BASS_ChannelSetAttribute(streamfx, BASSAttribute.BASS_ATTRIB_VOL, Volume)
Bass.BASS_ChannelPlay(streamfx, True)
End Sub
Issue #2:
The song does not automatically replay when I call Bass.BASS_ChannelPlay(streamfx, True). Will I just have to use the SYNCTRACKEND callback to do so?