Game Development Community

Joe Rossi: About your Audio Behaviours

by Michael Hartlef · in Torque Game Builder · 01/06/2008 (6:11 am) · 9 replies

Hi Joe,

I try to bring a little sound into my game prototype. I copied your 2 audio behaviours from the TDN into the behaviour folder of my game. I can add them to a sprite (which is a visible one) and set them properly. When I try to invoke the sound from the console or from inside a collision routine via

alxPlay(testSnd)

no script error messages appear, but also no sound. Any idea what I could have missed? This project was created via TGB 1.6.

The settings for the profile behaviour are

Name: testSnd
fileName: ~/data/audio/tntExplode.ogg <= I moved the file to C://tntExplode.ogg but also no sound
Volume: 1.000
description: AudioChannel2 <= I tested it with a Description added via your behaviour too, same result :(

When I run the adventure pack template, sound appears, so I don't think it is hardware related. Must be something silly what I'm overlooking.

Bye
Michael

#1
01/06/2008 (8:06 am)
Hi Michael,

I tested Joe's behaviours out a few days ago and worked fine for me.

Just put audio in data/audio where you had it originally and make the file name just the file name not the path.

So, say I have a project called "SoundTest" ... the audio would go here ..

SoundTest\game\data\audio

In that folder I have a file called volumeTest.wav that name is what goes in the file name box not any path info.


Hope that helps :)
#2
01/06/2008 (8:37 am)
Saiko is correct. Hope you got it working now.
#3
01/06/2008 (10:44 am)
Thanks guys, that did the trick.
#4
01/06/2008 (10:46 am)
Dooh, looking at the script of the behaviour, I could have found out myself. Like I said, silly and just a small thing. But sometimes you don't see the forest because there are to much trees infront of you. :)
Thanks again
#5
01/06/2008 (12:38 pm)
@Michael - lol no worries... is pretty much what I did first time as well ;)
#6
09/05/2008 (7:12 am)
Is it possible to reorder your Object Tree?

I built my game, then went to add the Audio Behaviors and read on the download page that they have to be listed HIGHER than the Objects that you want to be able to use sound.

So, without rebuilding my entire game, is it possible to just move my Audio Description and Audio Profile objects higher in the Object Tree, or should I have planned out all my audio ahead of time, before adding any other scene objects?

Thanks!
#7
09/05/2008 (11:25 am)
@Patrick

Ok I see what you are saying, after looking at that behavior. You should be able to open your level file (data/levels/blabla.t2d) and copy/paste your objects that have the audio behavior to the top of the level file. Objects are created and assigned id's based on the order in this file.

Keep in mind that this isn't the "normal" way to create audio profiles. If you define all your profiles in datablocks.cs they will all be created before the level is loaded and you can use them anywhere, in-game or in the editor.
#8
09/05/2008 (11:37 am)
I posted the code to allow reordering of the object tree a long time ago. I have no idea where or when it was though, you'll have to search :(
#9
09/05/2008 (7:44 pm)
Thanks for the help guys.

I decided to just set up my descriptions and profiles the old fashioned way for the time being, and everything is working fine. I can still use Audio Behaviors (like Play Sound On Collision) to reference the profiles in my audio.cs file, and it works great.

I'm still learning all of this so I really appreciate the input you guys have provided. Thanks again.