Complete FMOD PureBasic port
Complete FMOD PureBasic port
Hi ! Another PureBasic port of the excellent FMOD library can be found here with 8 examples.
-
- Enthusiast
- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact:
Hi ! This is because Brett will add the url to this port, though PB users will not need to download the PB Port + the official FMOD archive. Here, all is packaged and ready to use 
Btw, i see in your fmod examples that FSOUND_GetCpuUsage() works fine, i don't know why it doesn't work with fmod 3.70, if you have an idea ...
FSOUND_GetVersion() is the other function wich i can't manage to get it working

Btw, i see in your fmod examples that FSOUND_GetCpuUsage() works fine, i don't know why it doesn't work with fmod 3.70, if you have an idea ...
FSOUND_GetVersion() is the other function wich i can't manage to get it working

-
- Enthusiast
- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact:
Okay, so the PB-port becomes half-official for Brett
To answer your question:
1. Fsound_GetCPUUsage() returns a Float-value. You forgot the .f in your Includefile "fmod_proc.pbi":
2. But that doesn't solve the problem. There's a PB-Bug with recieving Float-values from CallFunction().
See here: viewtopic.php?p=36409#36409
So as a workaround for the moment we have to insert the two following lines directly behind the function call:
So here's an example:
I think it makes no sense to implement those two lines inside your Wrapper-Procedures, because it's just a temporarily workaround.
I have not tested it with the corrected FSOUND_GetCPUUsage() until now, but I think it'll work, too.

To answer your question:
1. Fsound_GetCPUUsage() returns a Float-value. You forgot the .f in your Includefile "fmod_proc.pbi":
Code: Select all
Procedure.f Fsound_GetCPUUsage()
See here: viewtopic.php?p=36409#36409
So as a workaround for the moment we have to insert the two following lines directly behind the function call:
Code: Select all
!FSTP dword [esp]
!POP [v_result] ; replace 'result' by the Float-variable name for the Function-result
Code: Select all
IncludeFile "con_struc.pbi"
IncludeFile "fmod_proc.pbi"
Global result.f
LoadFmod()
result.f = FSOUND_GetVersion()
!FSTP dword [esp]
!POP [v_result]
MessageRequester("",StrF(result),0)
CloseFmod()
I have not tested it with the corrected FSOUND_GetCPUUsage() until now, but I think it'll work, too.
%1>>1+1*1/1-1!1|1&1<<$1=1
Ok, i missed this topic, i was searching the forum for StrF() function wich i think it was faulty =)
I ll keep the sourcecode without this modification, as you said, it is only a temporarly workaround. I d rather prefer to wait for a PureBasic update or i ll try to ask Brett to return a String rather than a float (i don't think i ll change his Api only for purebasic users but who knows ... ).
Btw, thanx answering me and for this code snippet, i also just began to learn asm (a week ago)
I ll keep the sourcecode without this modification, as you said, it is only a temporarly workaround. I d rather prefer to wait for a PureBasic update or i ll try to ask Brett to return a String rather than a float (i don't think i ll change his Api only for purebasic users but who knows ... ).
Btw, thanx answering me and for this code snippet, i also just began to learn asm (a week ago)

Fmod 3.71 for PureBasic is up and ready with two new examples (cdda playback/rip), get it here.
- Le Soldat Inconnu
- Enthusiast
- Posts: 306
- Joined: Wed Jul 09, 2003 11:33 am
- Location: France