|
axisdj
Posts: 10
|
 |
« on: 19 Jun '11 - 18:47 » |
Quote
|
Cannot get this to work, Looked through out the forum, and all responses explaing how to mix the first two, my issues is how to continue after that: here is some code (vb6)
here is where I preload the next song
"picknextsong"
if activeplayer = 1 then
If newPlayer1 <> 0 Then Call BASS_ChannelStop(newPlayer1) Call BASS_StreamFree(newPlayer1) End If If newPlayer1 = 0 Then newPlayer1 = BASS_StreamCreateFile(BASSFALSE, StrPtr(nextSong1), 0, 0, BASS_STREAM_DECODE) End If end if
elseif activepalyer =2 then
If newPlayer2 <> 0 Then Call BASS_ChannelStop(newPlayer2) Call BASS_StreamFree(newPlayer2) End If If newPlayer2 = 0 Then newPlayer2 = BASS_StreamCreateFile(BASSFALSE, StrPtr(nextSong2), 0, 0, BASS_STREAM_DECODE) End If end if
here is where I start the next song, this works the first two, but after that it gives me error code 5 invalid handle Startnextsong gets called when 1 second of the currently playign song is reached
"StartnextSong"
if activeplayer = 1 then If newPlayer2 <> 0 Then Call BASS_Mixer_StreamAddChannel(mixer, newPlayer2, BASS_STREAM_AUTOFREE) '' add the 2nd recording Call BASS_ChannelPlay(newPlayer2, 0) Call BASS_ChannelSetAttribute(newPlayer2, BASS_ATTRIB_VOL, 1) Call BASS_ChannelSetSync(newPlayer2, BASS_SYNC_SLIDE, 0, AddressOf newPlayer2FadeOutDone, 0) activePlayer = 2 If newPlayer1 <> 0 Then Call BASS_ChannelSlideAttribute(newPlayer1, BASS_ATTRIB_VOL, -100, 1000) '''fade out other song End If End If elseif activeplayer = 2 or activeplayer 0 then If newPlayer1 <> 0 Then Call BASS_Mixer_StreamAddChannel(mixer, newPlayer1, BASS_STREAM_AUTOFREE) '' add the 2nd recording call BASS_ChannelPlay(newPlayer1, 0) Call BASS_ChannelSetAttribute(newPlayer1, BASS_ATTRIB_VOL, 1) Call BASS_ChannelSetSync(newPlayer1, BASS_SYNC_SLIDE, 0, AddressOf newPlayer1FadeOutDone, 0) activePlayer = 1 If newPlayer2 <> 0 Then Call BASS_ChannelSlideAttribute(newPlayer2, BASS_ATTRIB_VOL, -100, 1000) ''fade out other song End If End If end if
in the newPlayer1FadeOutDone and newPlayer2FadeOutDone callback functions I call "picknextsong"
My thought is after a stream is created using BASS_StreamCreateFile can I just change the file it is playing or do I have to create a new instance?
Thanks
|