Game Development Community

Playing sound file produces only static

by Bryce Fosheim · in Torque Game Builder · 02/02/2012 (7:41 am) · 4 replies

I've devoured a large amount of Torque information in the past month, but I haven't encountered anything that seems to be on level with what I'm having trouble with. I'm using Torque2D 1.7.6, and at a loss because I haven't read any other mention of something like this happening.

I have 2 audio files that are both ".wav". I run them both through script, and the background loop works perfectly.

On the other hand, the second file just plays as heavy static when played through the TGB run-time. The file works perfectly when ran through any other player I've tried.

Here's the Description and the Profile for the sound that doesn't work.

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

new AudioProfile(VoiceTwo)
{
	filename = "~/data/audio/FinalVoice002.wav";
	description = "AudioNonLooping";
	preload = true;
};

$sound = alxPlay(VoiceTwo);


#1
02/04/2012 (12:43 am)
I don't know what to say with this.

I've now gone through most of the sound files which were created for me, and only 6 work. The rest play static or don't play at all. Yet I can play them in possibly any audio player. Tried them in Windows Media Player, VLC, and Winamp.

I'm running:
32 bit Windows 7
1.7.6 Torque 2D
All sound files are ".wav"

Lost I am. Is there something with the audio codec used in Torque2D where it may not recognize a newer .wav?
#2
02/04/2012 (5:15 pm)
I used to have weird problems with ".wav" files. As soon as I converted them to ".ogg", they went away. Wish I knew what the problem was, but you might try converting them to see if the problem goes away.
#3
02/04/2012 (10:43 pm)
I vaguely recall reading an older thread on this... and it took a couple minutes searching to find it. Is the file that is not playing correctly fairly larger than the working one? You may want to try converting it to and .ogg, or try setting it to stream. Not sure if this is the same issue (original thread is from 2005), but apparently if the audio files are over a certain size it can have problems playing them.
#4
02/07/2012 (8:52 am)
Converting the files to .ogg worked. This made me very very happy.

I also checked the file sizes. If there is a bug with what size files are played, then ours aren't big enough to hit that mark. Our largest sound file was 16 megs and it was 1 of the 6 that worked.