0
0

I have big trubble to get a cd-player to work.
I have tryed to modify the fmod.bas but I cant get it to work anyway.
Are here maybe someone that can help me with an example of a cd-player.

I like it to play, pause, stop, get number of songs …….

Please 😥

//Bosse

  • You must to post comments
0
0

Can you post a sample of the code that you cannot get working? The CD functions are some of the simplest in FMOD. It should not be difficult to point you in the right direction.

  • You must to post comments
0
0

Hi again,
I have here put down one version of the code that I have tested.
I haven´t got any of all my tests to work.
The Declare I found in Fmod and then oI have made the changes I kfound here om this forum.
Can anyone please see what I have made wrong….

//Bosse

‘************
‘* FSOUND CD
‘************
Public Declare Function FSOUND_CD_Play Lib “fmod.dll” Alias “_FSOUND_CD_Play@4 (ByVal Drive As Byte, ByVal Track As Long) As Byte” ()
Public Declare Function FSOUND_CD_SetPlayMode Lib “fmod.dll” Alias “_FSOUND_CD_SetPlayMode@4” (ByVal Drive As Byte, ByVal mode As FSOUND_CDPLAYMODES) As Long
Public Declare Function FSOUND_CD_Stop Lib “fmod.dll” Alias “_FSOUND_CD_Stop@0” (ByVal Drive As Byte) As Byte
Public Declare Function FSOUND_CD_SetPaused Lib “fmod.dll” Alias “_FSOUND_CD_SetPaused@4” (ByVal Drive As Byte, ByVal Paused As Byte) As Byte
Public Declare Function FSOUND_CD_SetVolume Lib “fmod.dll” Alias “_FSOUND_CD_SetVolume@4” (ByVal Drive As Byte, Volume As Long) As Byte
Public Declare Function FSOUND_CD_Eject Lib “fmod.dll” Alias “_FSOUND_CD_Eject@0” (ByVal Driver As Byte) As Byte

Public Declare Function FSOUND_CD_GetPaused Lib “fmod.dll” Alias “_FSOUND_CD_GetPaused@0” (ByVal Driver As Byte) As Byte
Public Declare Function FSOUND_CD_GetTrack Lib “fmod.dll” Alias “_FSOUND_CD_GetTrack@0” (ByVal Driver As Byte) As Long
Public Declare Function FSOUND_CD_GetNumTracks Lib “fmod.dll” Alias “_FSOUND_CD_GetNumTracks@0” (ByVal Driver As Byte) As Long
Public Declare Function FSOUND_CD_GetVolume Lib “fmod.dll” Alias “_FSOUND_CD_GetVolume@0” (ByVal Driver As Byte) As Long
Public Declare Function FSOUND_CD_GetTrackLength Lib “fmod.dll” Alias “_FSOUND_CD_GetTrackLength@4” (ByVal Driver As Byte, ByVal Track As Long) As Long
Public Declare Function FSOUND_CD_GetTrackTime Lib “fmod.dll” Alias “_FSOUND_CD_GetTrackTime@0” (ByVal Driver As Byte) As Long

Public Sub CDPlay(Driver As String, Track As Integer) As Byte
Dim x As Byte

FSOUND_CD_Play(Driver, Track)

End Function

Public Sub CDStop(Driver As String) As Byte

CDStop = FSOUND_CD_Stop(Driver)

End Function

  • You must to post comments
0
0

I don’t claim to understand VB code, but it looks like you are trying to pass a string as the Driver parameter.

The first parameter of the CD functions take a signed byte that specifies the drive number to use. The first CD drive is 0. The next drive is 1. And so on. Also, check the return value. This will tell you if the function failed or succeeded.

  • You must to post comments
0
0

I have tryed everything I can think of, but no, I cant get it to work.
I have tryed to send Byte as well….

Have anyone something for me???

//Bosse

  • You must to post comments
0
0

Yes, I have tryed with 0 also.
I have got it to work a little but if I use the function more then one time everything is stop working.
I can’t stop the CD-player and VB has stopped to answer. The only thing that I can do is to restart the computer.
I’m not very good in C, but if I see in the doc there are use Char as Driver but in the Declare there are use Byte. Is this two the same???

//Bosse

  • You must to post comments
0
0

A byte is simply an unsigned char. They both take 8 bits. A byte can range from 0 to 255. A char can range from -128 to 127. The only difference is that the topmost bit in a char is used as the sign bit.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.