I can’t get this thing to work. I’m sure I’m doing something very obvious wrong, but I can’t figure out what; Any help?
Dim btFile() As Byte
Dim stream As Long
Dim channel As Long
Private Sub Form_Load()
FSOUND_SetOutput FSOUND_OUTPUT_DSOUND FSOUND_SetDriver 0 FSOUND_SetMixer FSOUND_MIXER_QUALITY_AUTODETECT If FSOUND_Init(44100, 32, FSOUND_INIT_GLOBALFOCUS) > 0 Then ReadFile AppPath & File stream = FSOUND_Stream_OpenFile(VarPtr(btFile(0)), FSOUND_LOADMEMORY Or FSOUND_2D, 1024) 'I'm not really sure about this value, I just put something that sounded nice, I also tried Ubound(btFile) 'stream = FSOUND_Stream_OpenFile(AppPath & File, FSOUND_16BITS, 0) 'This one does work Debug.Print "Stream" & stream channel = FSOUND_Stream_Play(FSOUND_FREE, stream) Debug.Print "Channel" & channel 'always returns -1 End If
Private Sub ReadFile(filename As String)
Dim filenr As Integer
filenr = FreeFile Open filename For Binary As #filenr ReDim btFile(LOF(filenr) - 1) Get #filenr, , btFile Close #filenr
- Anonymous asked 15 years ago
[quote="Sly":2o87cubz]Store the length of the file into another variable and pass that as the last parameter to FSOUND_Stream_OpenFile.[/quote:2o87cubz]
That should be the same value as the Ubound of my ByteArray +1…
I tried it anyway, but it didn’t change anything.
Please login first to submit.