[quote="brett":2ghatelv]hi. Did you simply upgrade the 3.73-3.74 dll or did you also use the new fmod.pas? Im wondering if it could have been a subtle change in the delphi header that we missed.
It is strange that it works with the C/C++ version, that makes me think the dll is ok. It could be something that the delphi compiler sets up that makes it happen.
Do you have an exe that errors on all machines? If you have a very reliable reproduce case zip the exe and send it to me and i can test it with fmod’s debug dll to see what it could be.[/quote:2ghatelv]
I simply upgraded from 3.73 to 3.74. I’m using VB.NET 2003. The way to reproduce the error works 100%, every single time.
Here is the code I use to open:
[code:2ghatelv] Public Function Media_OpenFile(ByRef Path As String) As Boolean
Try Call ResetFMod() streamHandle = FSOUND_Stream_Open(Path, FSOUND_MODES.FSOUND_NORMAL, 0, 0) If streamHandle <> 0 Then streamChannel = FSOUND_Stream_Play(1, streamHandle) 'reason why I used 1 is because, fmod likes to play more than 1 song at a time, even after doing 'ResetFMod, usually does it when it gets lagged. MediaFileName = Path Call Media_SetVolume(mVolume) Call Media_SetMute(mMute) Call ScrollID3() Return True Else Call ResetFMod() Return False End If Catch ex As Exception Debug.WriteLine(ex.ToString) End Try End Function[/code:2ghatelv]
[code:2ghatelv] Public Sub ResetFMod()
Try Call FSOUND_Stream_Close(streamHandle) streamHandle = 0 streamChannel = 0 MediaFileName = vbNullString Catch ex As Exception Debug.WriteLine(ex.ToString) End Try End Sub[/code:2ghatelv]
[code:2ghatelv]Private Declare Function FSOUND_Stream_Open Lib "fmod.dll" Alias "_FSOUND_Stream_Open@16" (ByVal filename As String, ByVal mode As FSOUND_MODES, ByVal offset As Integer, ByVal length As Integer) As Integer
Private Declare Function FSOUND_Stream_Play Lib "fmod.dll" Alias "_FSOUND_Stream_Play@8" (ByVal channel As Integer, ByVal stream As Integer) As Integer
A little bit more testing and I’ve come to find out that, the code seems to only error if it’s called within an Event handler fired from another class.
So, I could call the code from a menu, works perfect. If a class fires an event, and it calls the same code as in the menu, it will error with the windows crash box. But remember, if i’m using 3.73, this error doesn’t occur AT ALL, it only happens with 3.74, so i’m thinking something updated, declaration wise?
[quote="brett":16y3yn1v]Ok if you’re calling fmod from different threads then don’t. It sounds like what it possibly happening to cause the problem. FMOD isn’t guaranteed to be thread safe. Only call fmod commands from the same thread.
I didnt mean post delphi code by the way, we don’t support delphi.
I would want to see the exe. (and the ‘details’ of the error dialog you posted would have been more useful to us).[/quote:16y3yn1v]
Seems like the thread issue was the problem, that and some weird .NET bug between Timers, classes and events. Thanks for your time.
[quote="brett":20auzgc2]No. All wma’s play fine here. It is probably something to do with your media player install. What happens if you just play some wma’s with the fmod media player?[/quote:20auzgc2]
It works perfectly fine in the fmod media player, I even tried to get it to error, no dice. This happens on 2 other peoples computers, while using my program, so it’s not my media player install.
The really weird thing is, it will not error if you try to play the song one way, but all other ways it does. But they all use the same function to open and play the song. It’s really odd, I’m still looking into it.
- Anonymous answered 13 years ago
I forgot to mention that, if I use 3.73 and try to recreate the error, it works fine. It only does it on 3.74. So, it has to be something in the dll itself.
Sorry about this reply, but i coudln’t edit my previous post, registered now though. 😮
Please login first to submit.