0
0

Hey folks,

I’m trying to get FMUSIC_LoadSongEx2 working for me in vb6; and am having a lot of trouble.

Does anyone have a working example of it?

<help!>

😀

Thanks!

  • You must to post comments
0
0

Hey Folks!

So.. guess what! I finally got it working (well, someone from http://www.visualbasicforum.com/) solved it.

The key is… the load routine -> takes a period of time to init if from memory. So a straight play back doesn’t work. But this does:

  • enjoy! *

[code:l9miyyyt]
Dim mod_data() As Byte
Dim mod_play As Long
Dim mod_size As Long
Dim mod_name As String

Private Sub Form_Load()
FSOUND_Init 44100, 32, FSOUND_INIT_GLOBALFOCUS
mod_name = "2nd_pm.s3m"

Open mod_name For Binary As #1
mod_size = LOF(1)
ReDim mod_data(mod_size – 1)
Get #1, , mod_data
Close #1

mod_play = FMUSIC_LoadSongEx2(mod_data(0), 0, mod_size, FSOUND_LOADMEMORY, ByVal 0, 0)

‘ You’ll probably want to add a timeout to this as well
Do
DoEvents
Loop While FMUSIC_GetOpenState(mod_play)

FMUSIC_PlaySong mod_play

End Sub

Private Sub Form_Unload(Cancel As Integer)
FMUSIC_StopSong mod_play
FSOUND_Close
End Sub
[/code:l9miyyyt]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.