SFML community forums

Help => Audio => Topic started by: Walker on March 01, 2010, 09:21:33 am

Title: Alternative audio libraries - suggestions?
Post by: Walker on March 01, 2010, 09:21:33 am
Hey guys. I am working on a game right now with levels being generated infinitely.

Anyway, I wanted to have a simple looping melody for "music" and I was going to shift the tempo up each level. As far as I know, OpenAL and SFML can't do this - it is quite a difficult operation (if it can even be done realtime on my hardware, while there is other stuff using my CPU). So I am looking for a different audio library to use. Either one that can change tempo of an mp3/ogg/whatever without shifting the pitch too, or perhaps a library to play MIDI or popular tracker formats, or even a SID emulator or SPC700.

Has anyone here got any experience with anything like this or any suggestions?

By the way, I have thought about having a different loop for each level, but when 15+ levels is a reasonable amount to get through on your first play, this seems a little excessive.

Cheers guys.

PS Sorry for asking for <not SFML> in the SFML forum, Laurent. It handles everything else beautifully :)
Title: Alternative audio libraries - suggestions?
Post by: Trass3r on March 02, 2010, 10:03:39 pm
Maybe fmod, don't know if it supports that.
Title: Alternative audio libraries - suggestions?
Post by: Walker on March 03, 2010, 06:00:14 am
Thanks, will try it out tonight. Has a pretty long feature list. I would prefer and open source library though.
Title: Alternative audio libraries - suggestions?
Post by: model76 on March 07, 2010, 05:38:07 am
What you are asking about is known as "time stretching" in the pro audio world, and is indeed a difficult task. Especially if you want it to sound good, too... I think you will be hard pressed to find an audio library for games that can do this in real time.
I think your best bet would be to apply such an operation to the sound, between levels, because of the complexity.

I have no idea where you could find such an algorithm, or how to apply it, though.
Title: Alternative audio libraries - suggestions?
Post by: Walker on March 07, 2010, 05:41:03 am
Thanks for the tip. I've decided to look into midi libraries for now.
Title: Alternative audio libraries - suggestions?
Post by: SFMLaw on March 13, 2010, 01:08:20 pm
I was just looking over SoundTouch myself...

http://www.surina.net/soundtouch/index.html

Could be good!