Game Development Community

Audio Problem

by Zeinad · in Torque Game Builder · 04/02/2009 (12:59 pm) · 2 replies

I have a problem with audio in my game, specifically its not playing. I have my audio set up like this (as is shown in the audio section of the torque documentation):

new AudioDescription(AudioLooping)
{
volume = 1.0;
isLooping= true;
is3D = false;
type = $GuiAudioType;
};

new AudioProfile(testAudio)
{
filename = "./game/data/audio/open.wav";
description = "AudioLooping";
preload = true;
};

then, in a function that is called when the background image of the level is loaded i have:

error("music");
alxPlay(testAudio);

the error shows up where it is expected to, no audio comes forth. I have tried using both .wav and .ogg format, are their any other steps I may be missing? Or any other steps I can take in attempt to debug?

#1
04/02/2009 (1:53 pm)
Try this instead.

filename = "~/data/audio/open.wav";
#2
04/02/2009 (6:43 pm)
Awesome, that is a definite step in the right direction, thank you!

I now have the one file playing properly, however for some reason I cannot seem to play .ogg files. I am not sure offhand if that .wav file is mono or stereo, but I have tried several mono and several stereo .ogg files (not sure if it matters if they are mono or stereo, but I seem to recall that it does), but none of them seem to be playing. I am going to get a few more .wav files in a bit just to double check that the problem is between .wav and .ogg and not something else.

However, I need .ogg files to be working in the long term due to file size, any ideas would be greatly appreciated.