0
0

Hi

I’m developing in C# using SharpDevelop and FMOD Ex API 4.00.28 beta.

I have modified the C# example readtags slightly. The old code was

[code:1obznqnh]
...
result = system.init(1000, 2, FMOD.INITFLAG.NORMAL, (IntPtr)null);
ERRCHECK(result);

/*
Open the specified file. Use FMOD_CREATESTREAM and FMOD_DONTPREBUFFER so it opens quickly
*/
result = system.createSound("../../examples/media/wave.mp3", (FMOD.MODE.SOFTWARE | FMOD.MODE._2D | FMOD.MODE.CREATESTREAM | FMOD.MODE.OPENONLY), ref sound);
ERRCHECK(result);
...
[/code:1obznqnh]

I changed that to:

[code:1obznqnh]
...
result = system.init(1000, 2, FMOD.INITFLAG.NORMAL, (IntPtr)null);
ERRCHECK(result);

OpenFileDialog dialog = new OpenFileDialog();
dialog.ShowDialog();

/*
Open the specified file. Use FMOD_CREATESTREAM and FMOD_DONTPREBUFFER so it opens quickly
*/
result = system.createSound(dialog.FileName, (FMOD.MODE.SOFTWARE | FMOD.MODE._2D | FMOD.MODE.CREATESTREAM | FMOD.MODE.OPENONLY), ref sound);
ERRCHECK(result);
...
[/code:1obznqnh]

That should be OK, shouldn’t it?

But about 2/3 of the time I run the application, I get the following exception:

[code:1obznqnh]
System.NullReferenceException: Object reference not set to an instance of an object.
at FMOD.Sound.FMOD_Sound_GetTag(IntPtr sound, String name, Int32 index, TAG& tag)
at FMOD.Sound.getTag(String name, Int32 index, TAG& tag) in d:\Data\Dokumenter\SharpDevelop Projects\AudioPlayer 2\CsFMODWrapper\CsFMODWrapper\FMOD\fmod.cs:line 2300
...
[/code:1obznqnh]

The rest of the time the tags gets loaded OK.

Anyone have any idea what’s going on? Is it because the dialog messes about with the current directory? Or is it the filename argument that’s no longer a string literal?

Regards
Nicolai

  • You must to post comments
0
0

I don’t really know, but I’ve been having some problems with tags and C#, so I want an answer too :)

  • You must to post comments
0
0

“old” is only 4 days…

  • You must to post comments
0
0

Well, I think v28 was still the newest one out when I posted my problem.

But anyway, the problem is still there in v30.

/Nicolai

  • You must to post comments
0
0

I’m having the same problem ( using v30). Here are some specifics:

-The problem only occurs with certain songs, even though these songs were ripped at the same time (using CDeX) as the successful songs, so the encoding, and tags should be the same.
-If the song is loaded on it’s own, it works find. But if I load multiple songs at a time, the problem occurs (once again…only on certain specific songs).
-I get the same error as nicba (null reference error in getTag).

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.