0
0

I have a problem with CD playing using FMOD:

[color=orange:r2h85vq5]Some important pieces of VB6 code 😉 :


FSOUND_Init(44100, 32, 0)

Private Sub PlyO_Click()
Call FSOUND_CD_Play(0, 1)
End Sub

Private Sub NxtO_Click()
Dim Trk
Trk = FSOUND_CD_GetTrack(0)
Trk = Trk + 1
Call FSOUND_CD_Play(0, Trk)
End Sub

Private Sub StpO_Click()
Call FSOUND_CD_Stop(0)
End Sub
…[/color:r2h85vq5]

When I click on ‘PlyO’ button, program successfully starts playing track 1. I can stop it with StpO and then start it again and everything is allright. But when I use NxtO routine to play next track, program starts playing it BUT totally freezes. Nothing helps, even when I wait for cd track to end program doesn’t continue running.

I tried to make following change (play track 2 directly without playing track 1 before):
[color=orange:r2h85vq5]…
Private Sub PlyO_Click()
Call FSOUND_CD_Play(0, 2)
End Sub
…[/color:r2h85vq5]
and program crashes also.

Someone knows how to solve this?

  • You must to post comments
0
0

I’m not sure if this will work, but perhaps you should stop the currently playing track before you play the next one.

  • You must to post comments
0
0

Try using streams to play and not the cd functions of FMOD.

Example:

After Initialisation

To Open: (SelectedDrive = “H:”)

cdHandle = FSOUND_Stream_Open(SelectedDrive, 0, 0, 0)
TotalTracks = FSOUND_Stream_GetNumSubStreams(cdHandle)

To Play: (TrackFromCD is Track Number i.e 0)

FSOUND_Stream_SetSubStream cdHandle, TrackFromCD
CDChannel = FSOUND_Stream_Play(FSOUND_FREE, cdHandle)

TBE

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.