Game Development Community

Playing very long ambient soundtracks

by Clint S. Brewer · in Torque Game Engine · 10/27/2004 (8:27 am) · 25 replies

To put it in perspective, I just purchased my license on the 22'nd, but have gotten a lot of things working so far. Thank to all the docs, and helpful forum posts.

One problem I haven't solved yet has to do with my ingame ambient sound track.

I have it working just fine as long as the ogg file is relatively small, but when I try to play a large ogg file, say about 8 megs (It's a 10 minute loop, wich I would really just like to stream) the engine seems to freeze on load. I don't see anything interesting in the console log and no errors pop up.

At first I thought that perhaps it was just loading the entire thing before it would play it, but I let it run for a long time last night, and now I think it's just frozen.


Any advice would be greatly appreciated.


Here are some of the details of what I'm doing:

in client/scripts/audioProfiles.cs
new AudioProfile(InGameMusic)
 {
   //Clint
   //ingame.ogg is a hunge 8 meg ogg that seems to have trouble loading
   //ingame2 is a shorter, but still long 2 meg ogg that seems to load fine
   //investigating..
   
   //filename    = "~/data/sound/music/ingame.ogg";
   filename    = "~/data/sound/music/ingame2.ogg";
   description = "AudioMusic";
   preload = false;
 };

and in client/scripts/playGui.cs
function PlayGui::onWake(%this)
{
   // Turn off any shell sounds...
   // alxStop( ... );
   alxStop($MusicMenuMain);
   alxPlay(InGameMusic);   
.....


again thanks for any advice, I'll debug the code, but was hoping someone else might have a quick answer.
Page«First 1 2 Next»
#21
10/29/2004 (1:17 pm)
Clint - nice solution.

Yes, there is a bug in some ogg vorbis encoders. I think we have some fixes for that in 1.4, but the best solution is to use an encoder without the bug. ;)
#22
10/01/2005 (5:32 am)
You can use Audacity to convert from mp3 to Ogg audacity.sourceforge.net/
#23
10/11/2005 (1:54 am)
I can get ogg music to play just fine but it still takes several seconds to load the song into memory.
When I make it preload the delay happens when the script gets executed, otherwise the delay happens on the client whenever they decide to play the music. Shouldn't streaming cause this delay to effectively 'go away'? The files are only between 3 and 6 megs but they all take at least 5 full seconds to load. Is there a special trick to streaming the files, or is setting preload to 'false' all that is required?
#24
10/11/2005 (3:18 am)
I'm going to give this a try tonight too, I've got a fairly lengthy title song which causes the GUI to freeze on load and on exiting from a mission.. Not tried the streaming flag before.
It'll be nice to get the delays out, adds a nice level of polish to the proceedings if things are snappy and fast.
#25
10/11/2005 (5:34 pm)
Tried it, it worked a treat. Nice speedy main menu now. Thanks Kurtis.
Page«First 1 2 Next»