0
0

Hi everybody,
since this is my first post, let me thank you for this piece of SW that you give away for free, for us to play around with it, thanks! 😀

 That said, let's get to my problem, I'm trying to write a small Alarm to wake me up in the morning with a song I like, I'm doing that on a WIN2K machine, with VB6(SP5) and FMOD 3.63.

I’m trying to use the STREAM END callback, but when the song finishes my application crashes and returns me an Access Violation error in MSVBVM60.DLL, as anyone had the same problem?
– Am I doing something wrong in the code?
– Do I need to create an in-memory stream to attach a callback to it or can I just use the stream returned from Stream_OpenFile() ?
– Do I have to do anything more then calling Stream_SetSynchCallback?

Below you’ll find the code of the 2 procs…they both reside in the same module.

Thank you


Public Function END_STREAMCALLBACK(ByVal FSOUND_STREAM As Long, ByVal buf As Long, ByVal lenght As Long, ByVal param As Long) As Long
MsgBox “XX”
End Function

Public Sub playAlarm2(songfile As String)
Dim x As Byte
hdFileToPlay = FSOUND_Stream_OpenFile(songfile, FSOUND_2D, 0)

x = FSOUND_Stream_SetEndCallback(hdFileToPlay, AddressOf END_STREAMCALLBACK, 0)
If (CBool(x)) = False Then
    MsgBox "Error setting end callback..." & vbCrLf
End If
MsgBox "END callback set." & CBool(x)

If hdFileToPlay = 0 Then
    MsgBox "Error while opening file" & vbCrLf & FSOUND_GetErrorString(FSOUND_GetError)
End If

intChannel = FSOUND_Stream_Play(FSOUND_FREE, hdFileToPlay)

'MsgBox "After song starts playing..."
If (intChannel = -1) Then
    MsgBox "An error occurred playing the file!", , "Error..."
End If

End Sub


P.S. Am I allowed a little criticism? A little more work on the Docs? :roll:

<- Riki ->

  • You must to post comments
0
0

Do you have the same error with the stdcall version of Fmod dll ?

  • You must to post comments
0
0

Thanks for the stdcall lib advise, but now I’ve just tryied, and it stil doesn’t work… :(

<- Rki ->

  • You must to post comments
0
0

I have the same error with the stdcall version of Fmod, but with the 3.62 version. (Win XP)

  • You must to post comments
0
0

Has anybody some working VB code that uses the call back?
Please….

  • You must to post comments
0
0

I’m not shure what it is. When using a stop statement at the beginning of the callback functions, it works till that point, but Visual Basic crashes as soon I continue.

When using without stop statement, the same error occurs, but my player reacts and even loads the next song.

If anyone knows, please tell me either
(controller@gmx.co.uk / info@ctuser.net)

  • You must to post comments
0
0

I´m not sure what happen, but my program work nice in VB. When build an .exe and test it crashes when call FSOUND_Stream_SetEndCallback.
It only happen in .exe, not in VB. Any suggestion?

Other question, when use FSOUND_Stream_Close, it call FSOUND_Stream_SetEndCallback?

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.