HOW TO PLAY OGG (AUDIO ) FILE?
by karthikeyanK · in Torque Developer Network · 06/28/2009 (9:36 pm) · 3 replies
In My project I have to play an audio file(ogg). When the User click the button audio should play and when the user click the same button the audio should off? how to do that?
#2
Here i found code for playing sound.
function Testing()
{
$AudioTestHandleA = alxCreateSource("AudioIntroMusicProfile", expandFilename("data/sound/crowd.wav"));
if (!alxIsPlaying(%handle))
alxPlay(%handle);
else if(alxIsPlaying(%handle))
alxStop(%handle);
}
when i click the button the wav file is playing.. but when i click the same button the song is not off..
please spot error in my code...
07/14/2009 (4:46 am)
Here i found code for playing sound.
function Testing()
{
$AudioTestHandleA = alxCreateSource("AudioIntroMusicProfile", expandFilename("data/sound/crowd.wav"));
if (!alxIsPlaying(%handle))
alxPlay(%handle);
else if(alxIsPlaying(%handle))
alxStop(%handle);
}
when i click the button the wav file is playing.. but when i click the same button the song is not off..
please spot error in my code...
#3
07/14/2009 (6:14 am)
See the other thread you created.
Torque Owner World-Loom
World LooM
Check this tdn.garagegames.com/wiki/TorqueScript_Console_Functions_1 to learn about audio in Torque.