0
0

I was using the stream functions to get the cd info but reading all of the tracks prior to playing was slow. I was using:

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

then using a loop to get each tracks info

cdHandle = FSOUND_Stream_Open(SelectedDrive, 0, 0, 0)
Do Until GetAllTracks = totaltracks + 1
FSOUND_Stream_SetSubStream cdHandle, GetAllTracks
TuneLengthResult = PhraseTime(FSOUND_Stream_GetLengthMs(cdHandle) / 1000)
TuneLengthResultms = FSOUND_Stream_GetLengthMs(cdHandle) / 1000
PopulatePlayList ‘ writng info into a list box
GetAllTracks = GetAllTracks + 1
Loop
FSOUND_Stream_Close cdHandle
cdHandle = 0

I then switched to using the CD functions as it is almost instantaneous, but prior to this using a routine to get and store the CD Serial Number to check if the CD had been changed. I am using:

        Do Until GetAllTracks = totaltracks + 1
            TuneLengthResultms = (FSOUND_CD_GetTrackLength(asciiDrive, GetAllTracks) / 1000)
            frmPlayList.lstCDTimes(Selected).AddItem TuneLengthResultms
            GetAllTracks = GetAllTracks + 1
        Loop

My problem is that if I change the CD the serial is checked and confirms the change but the totaltracks = FSOUND_CD_GetNumTracks(asciiDrive) holds the same totaltracks value. I have tried resetting its value to zero in the hope it would get it but it still returns the previous CD info. I have tried using FSOUND_CD_Stop (asciiDrive) but its the same problem.

Is there a way of flushing the FSOUND_CD_GetNumTracks(asciiDrive) or closing the CD function. I have closed the cdHandle for the stream, as this is what I use to play, but no change. Using the stream method works fine but as stated earlier reading the track times is slow because it has to access all the tracks individually to get the info.

Thanx TBE

  • You must to post comments
0
0

I don’t know about the FSOUND_CD functions but have you tried the ‘!’ option with the FSOUND_Stream_Open function?
[code:2rvjz7df]
FSOUND_Stream_Open("d:!", 0, 0, 0);
[/code:2rvjz7df]

this will open the cd in quick mode

  • You must to post comments
0
0

I will try this. The problem seems to be that I installed VMWare Workstation and it turned off ‘AutoRun’ on the CD Drives, which meant windows didn’t read the disc being changed. I turned AutoRun back on and hey presto it worked.

Will let you know how I get on with your suggestion

TBE

  • You must to post comments
0
0

Just a quick reply for Chris who responded to my initial problem.

Your suggestion works fine, my problem was that I had already opened the stream without using the ‘!”‘ option and was then calling it again using the ‘!”‘ option without stopping the previous open.

Thanx for pointing me in the right direction anyway – TBE

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.