0
0

I want to play a MP3 using FSOUND_STREAM_OPENFILE but I got a message that the function does not exsits in the library. The documentation says I should use FSOUND_STREAM_OPEN to play streams but this does not work too.
How do I play MP3s with the stream functions?

  • You must to post comments
0
0

Now I got it! Here are the original declarations from the fmod.pas

[code:231v2zc4]function FSOUND_Stream_OpenFile(const Filename: PChar; Mode: Cardinal; MemLength: Integer): PFSoundStream; {$IFDEF LINUX} cdecl {$ELSE} stdcall {$ENDIF};

function FSOUND_Stream_OpenFile; external FMOD_DLL {$IFDEF MSWINDOWS} name ‘_FSOUND_Stream_OpenFile@12’ {$ENDIF};[/code:231v2zc4]

I changed it into

[code:231v2zc4]function FSOUND_Stream_Open(const Filename: PChar; Mode: Cardinal; MemLength: Integer): PFSoundStream; {$IFDEF LINUX} cdecl {$ELSE} stdcall {$ENDIF};

function FSOUND_Stream_Open; external FMOD_DLL {$IFDEF MSWINDOWS} name ‘_FSOUND_Stream_Open@12’ {$ENDIF};[/code:231v2zc4]

And it works! Thanks 😀

  • You must to post comments
0
0

In order for your problem to be solved you should post the code you are using. Most of these problems are caused by improper use of the function. In FMOD 3.7 it changed from FSOUND_Stream_OpenFile to FSOUND_Stream_Open, because an extra parameter was put in (offset).

  • You must to post comments
0
0

That’s just odd because the version of fmod.pas that is in the distribution already has that function renamed. You also have the old parameter names with an incorrect number of parameters. This is the correct declaration of FSOUND_Stream_Open from FMOD 3.70

[code:2py07vnp]
function FSOUND_Stream_Open(const name_or_data: PChar; Mode: Cardinal; Offset: Integer; Length: Integer): PFSoundStream; {$IFDEF LINUX} cdecl {$ELSE} stdcall {$ENDIF};
[/code:2py07vnp]

Note the parameter name name_or_data and there are four parameters, not three. Your code sample plainly tells me that you have a header file from an older version of FMOD because the function declaration you showed was from 3.63 and earlier.

  • You must to post comments
0
0

FSOUND_Stream_Open does not work. I got the message that the function is not found in the library.

This is my simple code:

[code:10w8i60x]mystream := FSOUND_STREAM_OPEN(PChar(’myfile.mp3’), FSOUND_NORMAL, 0);[/code:10w8i60x]

That’s how it is in the samples.
BTW: I’m working under Linux using Kylix. All other function for playing sounds, modules are worling fine.

  • You must to post comments
0
0

Ooh… hang on, Brett. I just downloaded the Linux distro and it contains the Delphi headers from 3.63. Ace was right. The Linux distro contains the 3.63 Delphi files.

Sorry, Ace. The Win32 distro has the correct Delphi files, but it seems the Linux distro got missed. Until the Linux distro is fixed, I would recommend downloading the Win32 distro and extracting the Delphi files from there.

  • You must to post comments
0
0

If the function is not found in the library, then you are using an older version of FMOD library (3.63 or earlier) with the new headers.

  • You must to post comments
0
0

Then the download of the Linux version includes an older version of the .so file. I will check that with the function for getting the libary version.

  • You must to post comments
0
0

No, I do not have an old version. 3.70 was the first I have downloaded.
I try to check the lib version this evening.

  • You must to post comments
0
0

I checked the version and it is 3.70 but FSOUND_STREAM_OPEN still not works.

  • You must to post comments
0
0

Are you using FSOUND_Stream_Open or FSOUND_STREAM_OPEN?

  • You must to post comments
0
0

I guess I wrote FSOUND_Stream_Open but I will check that this evening. You guess that’s the problem? Hm, I try that…

  • You must to post comments
0
0

It makes no diffrence.

FSOUND_STREAM_OPEN / FSOUND_Stream_Open = I can compile it but i got the message that this function is not available in the lib. Kylix unregisters my component in which I will use that code. So I can’t use it.
FSOUND_STREAM_OPENFILE / FSOUND_Stream_OpenFile = can’t compile it – function not found

Why is the function not found in the lib? Can this be a mistake in the lib file?

  • You must to post comments
0
0

I don’t use Linux, but I did download the Linux version of 3.70 and did a search through libfmod-3.70.so using a hex editor. I found the text “FSOUND_Stream_Open” as I expected to. So I do not know what else to suggest.

  • You must to post comments
Showing 13 results
Your Answer

Please first to submit.