Sound pitch parameter
by pastis · in Torque Game Builder · 08/30/2010 (11:21 pm) · 7 replies
Hello,
I saw somewhere it was possible to change the pitch of a sound.
But I don't understand how to use it in my code :(
For example I have my sound played:
playsound(jump01);
Is there a parameter I can add to my code for have the pitch effect.
Maybe I will add some random, but for now I just wanted to have the pitch...
Step by step, I will succeed :) Just need some help.
Thanks in advanced.
I saw somewhere it was possible to change the pitch of a sound.
But I don't understand how to use it in my code :(
For example I have my sound played:
playsound(jump01);
Is there a parameter I can add to my code for have the pitch effect.
Maybe I will add some random, but for now I just wanted to have the pitch...
Step by step, I will succeed :) Just need some help.
Thanks in advanced.
#2
I m not sure to understand.
Is it like that:
playsound(jump01, AL_PITCH, 0.5);
Because I don't have any error, and my sound is not played. :(
What I am supposed to do with this?
08/31/2010 (3:45 am)
Sorry for that but I am not so skilled for now.I m not sure to understand.
Is it like that:
playsound(jump01, AL_PITCH, 0.5);
Because I don't have any error, and my sound is not played. :(
What I am supposed to do with this?
#5
So I try those this:
alxSourcef(nameofmysound, AL_PITCH, 0.5);
or
alxPlay(nameofmysound, AL_PITCH, 0.5);
But it s not working. My sound is in 44hz and 8 bits and it s still not working.
What is wrong with my code?
09/02/2010 (3:38 am)
Ok. Thanks.So I try those this:
alxSourcef(nameofmysound, AL_PITCH, 0.5);
or
alxPlay(nameofmysound, AL_PITCH, 0.5);
But it s not working. My sound is in 44hz and 8 bits and it s still not working.
What is wrong with my code?
#6
Example:
And then...
09/02/2010 (5:14 am)
Change nameofmysound to your soundhandle.Example:
new AudioProfile(nameofsound) {
filename = expandFilename("~/data/audio/sound/sound1.ogg");
description = "AudioNonLoopingEffect";
preload = false;
};And then...
$testSound = alxPlay(nameofsound); alxSourcef($testSound,AL_PITCH,0.5);
#7
Thanks for all your help.
I hope in the future it will be me who learn you something to you. ;)
09/11/2010 (5:17 pm)
Yes it's working perfectly.Thanks for all your help.
I hope in the future it will be me who learn you something to you. ;)
Associate William Lee Sims
Machine Code Games
tdn.garagegames.com/wiki/TorqueScript_Console_Functions_1
If I remember right, you'll need the alxSourcef function.