I have built a program that uses 2 decks, but if deck 1 has played and when I want to play deck 2, it can't play. This also happens when I try it with deck 1.
The error is BASS_ERROR_ALREADY.
my code (VB.NET):
Loading Deck 1:
OpenFileDialog1.ShowDialog()
If (OpenFileDialog1.FileName = "") Then
Else
If Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero, Nothing) Then
' create a stream channel from a file
deck1 = Bass.BASS_StreamCreateFile(OpenFileDialog1.FileName, 0, 0, BASSFlag.BASS_DEFAULT)
Label1.Text = "DECK 1 GELADEN"
End If
End If
Loading deck 2:
OpenFileDialog1.ShowDialog()
If (OpenFileDialog1.FileName = "") Then
Else
If Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero, Nothing) Then
' create a stream channel from a file
deck2 = Bass.BASS_StreamCreateFile(OpenFileDialog1.FileName, 0, 0, BASSFlag.BASS_DEFAULT)
Label2.Text = "DECK 2 GELADEN"
End If
End If
Play Deck 1:
If deck1 <> 0 Then
Bass.BASS_ChannelPlay(deck1, False)
Label1.Text = "DECK 1 ACTIEF"
Else
Label1.Text = "DECK 1 KAN NIET AFSPELEN"
End If
Play Deck 2:
If deck2 <> 0 Then
Bass.BASS_ChannelPlay(deck2, False)
Label2.Text = "DECK 2 ACTIEF"
Else
Label2.Text = "DECK 2 KAN NIET AFSPELEN"
MsgBox("BASS retourneerde: " + Bass.BASS_ErrorGetCode().ToString())
End If
Is there something wrong with my code?