Page 1 of 1
Playing sound files
Posted: Fri Apr 12, 2013 12:27 pm
by Grey
DarkGod, you said before that you can get a file to play at different pitches by calling on a lua sound file for the game with certain settings. Would you mind explaining that thoroughly? I'd like to play about with this a lot.
Re: Playing sound files
Posted: Fri Apr 12, 2013 3:44 pm
by tiger_eye
DGrey, instead of playing the sound as such:
do it instead as:
Code: Select all
game:playSound({"the_sound_name", pitch=1, vol=0.5})
Note that the sound file is specified as a table, not a string. I think "pitch" is a scale value, such as if the initial sound was middle C, 2.0 would be an octave higher, and 0.5 would cause it to be an octave lower.
If you want to play one of many sound files randomly (such as "many_sounds5", "many_sounds6", "many_sounds7"), you can do:
Code: Select all
game:playSound({"many_sounds%d", 5, 7, pitch=1, vol=0.5})
OpenAL offers more ways to tweak sounds, and I'm sure extra functionality could be added to t-engine if you request it.
Re: Playing sound files
Posted: Fri May 24, 2013 12:32 pm
by Grey
Thanks, tiger_eye! Got this implemented in Mosaic now and it sounds way better :D
Re: Playing sound files
Posted: Wed May 29, 2013 10:00 am
by Grey
tiger_eye wrote:
OpenAL offers more ways to tweak sounds, and I'm sure extra functionality could be added to t-engine if you request it.
What about echo and reverb? Do you think those could be implemented in-engine?