0
0

In Visual Basic 6 I used this code to stop music:

    If lngFirstChan <> 0 Then
        Call FSOUND_Stream_Stop(lngFirstStream)
        lngFirstChan = 0
    End If

and, then, when I close my player, this code:

'Close the stream if exist
If lngFirstStream <> 0 Then
    Call FSOUND_Stream_Close(lngFirstStream)
    lngFirstStream = 0
End If
'FMod DLL's Terminate process
Call FSOUND_Close

but I found that the last music file played by fmod can’t be renamed or moved until I close all my application. What can I do to close all reference to last played file?
Thank you.

  • You must to post comments
0
0

[quote="luxornet"]In Visual Basic 6 I used this code to stop music:
If lngFirstChan <> 0 Then
Call FSOUND_Stream_Stop(lngFirstStream)
lngFirstChan = 0
End If
[/quote]

you set lngFirstChan = 0 here, so

[quote="luxornet"]
‘Close the stream if exist
If lngFirstStream <> 0 Then
Call FSOUND_Stream_Close(lngFirstStream)
lngFirstStream = 0
End If
[/quote]

will never close it (as it’s 0)

  • You must to post comments
0
0

Thank you very much.
Hope I can solve my problem…

  • You must to post comments
0
0

Sorry, forget about the last reply:

Try using following apis in given order:
FSOUND_SetVolume (set to 0, optional)
FSOUND_Stream_Stop
FSOUND_Stream_Close
FSOUND_StopSound

If not lngFirstChan = 0 Then
; Asuming you skip (unload) streams that are loaded (lngFirstStream <> 0) but cannot be played (lngFirstChan = 0) in the loading procedure
FSOUND_SetVolume(lngFirstChan, 0)
FSOUND_Stream_Stop(lngFirstStream)
FSOUND_Stream_Close(lngFirstStream)
FSOUND_StopSound(lngFirstChan)
lngFirstStream = 0
lngFirstChan = 0
endif

If still does not work, can you post (or eMail: info@ctuser.net) small example?

  • You must to post comments
0
0

I rewrite Unload form sub. as fallow:
Sub Form_Unload(Cancel As Integer)
If Not lngFirstChan = 0 Then
FSOUND_SetVolume lngFirstChan, 0
FSOUND_Stream_Stop (lngFirstStream)
FSOUND_Stream_Close (lngFirstStream)
FSOUND_StopSound (lngFirstChan)
lngFirstStream = 0
lngFirstChan = 0
End If
‘ Fermeture de la "FMod.dll"; FMod DLL’s Terminate process
Call FSOUND_Close
End Sub

I must completed my ‘StopMusic" sub., which had only:
Call FSOUND_Stream_Stop(lngFirstStream)
with this (how you suggested):
Call FSOUND_Stream_Close(lngFirstStream)

Now, all seems to be right. Need only more tests.
Thank you very, very much.
(Sorry for my English)

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.