NULL resource" error
by Thomas Corbett · in Technical Issues · 07/23/2008 (6:53 pm) · 7 replies
I'm trying to add audio to a small TGB project on Mac OS X. The data has been added to the audio directory, an audioDatablocks.cs has been created, the main.cs has been modified. However, when the project is run, there is no music. Instead, there is a Console error message:
ResourceObject::construct: NULL resource create function for 'mysong.mp3'.
Has anyone run into this error before? Would this be due to the .mp3 file type, or some other cause?
ResourceObject::construct: NULL resource create function for 'mysong.mp3'.
Has anyone run into this error before? Would this be due to the .mp3 file type, or some other cause?
About the author
#2
07/24/2008 (5:44 am)
Thats correct, Torque cannot play mp3 files.
#3
07/25/2008 (11:49 am)
Thanks for suggestions. Downloaded Audacity and converted mp3 --> ogg. Still no music. Checking main.cs and audioDatablocks.cs files. What are the typical newbie errors?
#4
07/25/2008 (11:53 am)
Make sure your AudioDescription and AudioProfile are getting created successfully. Make sure you have the appropriate AudioDescription if it is a 2D or 3D sound. If it is a 3D sound and you don't specify a position for it to play it will play at 0,0,0 which means you won't hear it.
#5
How would one know that AudioProfile and AudioDescription are getting created successfully?
So far, TGB has played only its built-in sounds. It has never played original sounds copied into the game/data/audio directory. Is there someplace else that audio files are referenced? Is there a procedure that needs to be followed when importing audio files?
07/28/2008 (6:54 pm)
Saturday, tried both ogg and wav files. Rechecked main.cs and audioDatablocks.cs, especially AudioProfile and AudioDescription. Watched Console for errors and fixed cs files. But didn't hear TGB play any sound. How would one know that AudioProfile and AudioDescription are getting created successfully?
So far, TGB has played only its built-in sounds. It has never played original sounds copied into the game/data/audio directory. Is there someplace else that audio files are referenced? Is there a procedure that needs to be followed when importing audio files?
#6
Try typing one of these in the console..
echo(isObject(YourProfile/Description))
YourProfile/Description.dump()
Is there a procedure that needs to be followed when importing audio files?
Not really, sounds like you are doing the right things.
07/28/2008 (11:49 pm)
How would one know that AudioProfile and AudioDescription are getting created successfully?Try typing one of these in the console..
echo(isObject(YourProfile/Description))
YourProfile/Description.dump()
Is there a procedure that needs to be followed when importing audio files?
Not really, sounds like you are doing the right things.
#7
08/01/2008 (12:43 am)
TGB is playing sound. I had overlooked the game.cs file.
Associate James Ford
Sickhead Games
The reason to use wav/ogg is those are open source formats and mp3 is not.