0
0

Dang. Release 8 is out and I was mostly through updating the Delphi version to release 7. I’d just found the bug in release 7 in the FMOD_DSP_DESCRIPTION struct where you had declared the create and release members as the read callback type. Checked it in release 8 and you have fixed it already.

I’ll finish the update for release 7 and then do the changes for release 8, which should be far fewer because I had not updated the Delphi version since the first release. :)

  • You must to post comments
0
0

I don’t think that C#’s string type can be passed directly to GetDriverName because GetDriverName expects a pre-allocated buffer to put the name in. The string type is a dynamically allocated buffer managed by C# that FMOD has no knowledge about. I believe you have to use a StringBuilder type (from my little knowledge of C#).

  • You must to post comments
0
0

[quote="brett":hixq2dxa]Sly btw thanks for the headers, we’ll use this as a reference and try to generate it ourselves using a perl script. What do you recommend we download to test delphi with? It seems to be a commercial product on borland.com is this true?[/quote:hixq2dxa]Borland did release a free personal edition of Delphi 6 that was available on their website, though that has since been removed. There was also a free personal edition of Delphi 7 that was distributed on an APC magazine coverdisk a while back. Delphi 8 is only for .NET, but comes with Delphi 7 in the box (to satisfy those customers that still needed to do Win32 development). Delphi 9 (to be released soonish) is for both .NET and Win32.

Another option is FreePascal. It is free, open-source and has a Delphi-compatible mode, but is not as easy to use as Delphi since it is primarily command-line.

  • You must to post comments
0
0

In fact, FMOD Ex is not Managed, so it cannot access managed memory…

When you init your string (with = “”), some memory is allocated, but it’s managed… so FMOD can’t access it (sometimes, you’ll probably get an exception…), and therefore can’t fill it …

You have to play with the Marshal functions… like this :

[code:ab3iqy77] IntPtr ptr = Marshal.AllocHGlobal(pLength);
Enums.FMOD_RESULT r = FMOD_Sound_ReadData(mSound, ptr, (uint)pLength, ref bytesRead);
if (r != Enums.FMOD_RESULT.FMOD_OK)
Global.Logger.Log("FMOD Error – ReadData() : " + r.ToString());
Marshal.Copy(ptr, pBytesBuffer, 0, pLength);
Marshal.FreeHGlobal(ptr);
[/code:ab3iqy77]

It’s not exactly what you will need, but it can help you… I think :)

This code allocates an unmanaged buffer, so FMOD can fill it with its data, then we copy this buffer to the managed memory, and free the unmanaged allocated buffer…

  • You must to post comments
0
0

There’ll be some gotcha’s with auto-generating the Delphi files, but I could definitely advise on the best way to get around those gotcha’s.

  • You must to post comments
0
0

[quote="brett":2w7pwvim]we should probably be auto generating the delphi header ourselves like we do with the .h file (all the C functions are generated from the fmod.hpp). I don’t think it would be too hard. (maybe).

(welcome back!)[/quote:2w7pwvim]
If you show me the script you use to autogenerate your delphi/c headers, I think I can write a similar script to generate the VB type library as well, if that helps.

  • You must to post comments
0
0

Awesome work brett and andrew, thanks ๐Ÿ˜‰

I will give it a spin asap

regards,
Cliff :)

  • You must to post comments
0
0

hi all :-)

i just wanna make a c#.net wrapper for v8alpha, but
2 silly questions:
1.) what is fmodexp ?
2.) system::init and all other functions want the system as first input parameter…i noticed that the help api is not updated with the correct version
is anybody else working on a .net wrapper?
anybody who can help me with the essential definitions ?
Is brett working on a .net class? ๐Ÿ˜‰

bye,
Thomas.

  • You must to post comments
0
0

[quote="MP3Observer":1oldvzyi]hi all :-)

i just wanna make a c#.net wrapper for v8alpha, but
2 silly questions:
1.) what is fmodexp ?
2.) system::init and all other functions want the system as first input parameter…i noticed that the help api is not updated with the correct version
is anybody else working on a .net wrapper?
anybody who can help me with the essential definitions ?
Is brett working on a .net class? ๐Ÿ˜‰

bye,
Thomas.[/quote:1oldvzyi]
FModEXp loads codecs from plugins instead of having them compiled in (that’s why it’s smaller).
The documentation is generally not up to date yet.

  • You must to post comments
0
0

maybe i missunderstand something:
fmodex.chm v8:
FMOD_RESULT System::init(
int maxchannels,
int maxsoftwarechannels,
FMOD_INITFLAGS flags,
void * hwnd
);

but when i see your democode, then i read:
result = FMOD_System_Init([b:1qrrpg7z]system[/b:1qrrpg7z], 1, 0, (FMOD_INITFLAGS)(FMOD_INIT_NORMAL | FMOD_INIT_GLOBALFOCUS), NULL);

parameter system is missing in the help

my big problem: FmodManaged from Pietro Partescano works only with 3.7, so i make my own C# class, with DLLIMPORT and all that shit ๐Ÿ˜‰
but, i am not sure what to return from system_init in c#, the system object…

i know brett, c# and managed code is not your stuff ๐Ÿ˜‰

but some help would be fine, for starting, then i can write a good little C# Player with a managed class for fmod.

bye,
Thomas.
MP[b:1qrrpg7z]3[/b:1qrrpg7z]Observer ;-))

  • You must to post comments
0
0

The C (not C++) function needs the system param, look at the headers.

  • You must to post comments
0
0

thx karlkox..my fault…just learning ๐Ÿ˜‰

now my C#.NET version for fmodex is working, but one error:

1.) call FMOD_System_GetNumDrivers
i get 1, good ๐Ÿ˜‰

2.) call FMOD_System_GetDriverName
my string is empty!

here is the code:

==== part of the C# fmod class ===============
namespace fmod.enums
{
public enum FMOD_RESULT
{FMOD_OK,…..}
}

namespace fmod
{
public class Information
{
[DllImport (“fmodex.dll”)]
public static extern fmod.enums.FMOD_RESULT FMOD_System_GetNumDrivers(IntPtr system,ref uint numdrivers);

[DllImport (“fmodex.dll”)]
public static extern fmod.enums.FMOD_RESULT FMOD_System_GetDriverName(IntPtr system,int id,string name,int namelen);
}
}
==== implementation ===============
uint numdrivers=0;
fmod.enums.FMOD_RESULT fmodRes;
fmodRes=fmod.Information.FMOD_System_GetNumDrivers(system,ref numdrivers);
string sDriverName=””;
for(iloop=0;iloop<=numdrivers;iloop++)
{
fmodRes=fmod.Information.FMOD_System_GetDriverName(system,iloop,sDriverName,200);

}

GetDrivername(0) is an empty string
GetDrivername(1) results FMOD_ERR_INVALID_PARAM ?

brett:
i am working on this c# wrapper, are you interested in it for the public?

  • You must to post comments
Showing 11 results
Your Answer

Please first to submit.