How to add a Chat sound?
by Lhh · in Torque Game Engine · 07/20/2002 (5:24 am) · 6 replies
I want to add a little "beep" when a chat message is sent, can anyone help me how to do this'? Would be nice...
#2
07/20/2002 (8:08 am)
oh, sorry... it doesnt work (he doesnt find the wav file.. )
#3
07/20/2002 (10:15 am)
Um, you have to have a sound file to play, and then change somesound.wav to the filename you added.
#4
(console says it cant load audio profile)
07/20/2002 (10:25 am)
lol, im not sooo stupid, i already did that ;) but it wont work... (no solution yet...)(console says it cant load audio profile)
#5
%wavfile = alxCreateSource("AudioChannel0", expandFilename("~/data/sound/testing.wav"));
alxPlay(%wavfile);
07/20/2002 (10:42 am)
do this instead:%wavfile = alxCreateSource("AudioChannel0", expandFilename("~/data/sound/testing.wav"));
alxPlay(%wavfile);
#6
07/20/2002 (12:20 pm)
still wont work for me...
Torque 3D Owner Robert Blanchet Jr.
Change this block of code:
// See if there's a sound at the end of the message, and play it. if ((%wavStart = playMessageSound(%message, %voice, %pitch)) != -1) { // Remove the sound marker from the end of the message. %message = getSubStr(%message, 0, %wavStart); }To this:
// See if there's a sound at the end of the message, and play it. if ((%wavStart = playMessageSound(%message, %voice, %pitch)) != -1) { // Remove the sound marker from the end of the message. %message = getSubStr(%message, 0, %wavStart); } else { // if there is no sound sent to us in the message // then play a default sound %wavFile = "someSound.wav"; alxPlay(%wavFile); }