Game Development Community

calling a sound thru a behavior

by rennie moffat · in Torque Game Builder · 04/25/2010 (11:19 am) · 3 replies

HI I had posted ealier about producing, managing sound in games and had made it work. however i have made some new code and the trigger works, on collision. but the audio won't play.


i have a behaviorfield set up so that when the object is triggered, it

alxPlay(%this,sound)
///where %this.sound is a string, in a behaviorfield.


this.sound, string is defined as
new AudioProfile(bkgLoop1)
{
   filename = "~/data/audio/music/bkgLoop1.wav";
   description = "AudioLooping";
   preload = false;
};

///and
///looping as
new AudioDescription(AudioLooping)
{
   volume = 1.0;
   isLooping = true;
   isStreaming = true;
   is3D = false;
 };

audio.cs is called in game.cs
What could I be doing wrong?
myfiles are wav and there etc. :::)))













About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
04/25/2010 (11:21 am)
and I was using channels earlier.


Are channels completely necessary?


#2
05/04/2010 (9:24 am)
1. alxPlay(%this,sound)
2. ///where %this.sound is a string, in a behaviorfield.
Line 1 you have a comma not a full stop, is this a typo?
#3
05/04/2010 (9:30 am)
yes. the problem or relevance is the white noise or static being produced, seemingly in iTGB.



TGB thread
http://www.torquepowered.com/community/forums/viewthread/114783


iTGB
http://www.torquepowered.com/community/forums/viewthread/109425