combine multiple sound files in one object?

hi guys,

I want to combine a couple of sounds into one file (within OF)

example:: load 4-5 sounds of 10 minutes each in its own ofSoundplayer object. And combine them into a single 50 minute sound object and then release the other 5… and keep one with all of them combined

I have some generic idea on how to do it with FMOD but

do we have an easy way to do that in OF?

like sound::append()?

So I ended up using a different method to combine the audio… (by using ofVideoplayer…)

now I have another problem…

in of007 it seems that ofVideoPlayer doesn’t work well with ofxQTKitVideoPlayer.

it stops after 1 sec.

any ideas on how to use both players in the same project… or basically even better load mp3 files in ofxQTKitVideoPlayer?

or any better soundplayer than ofSoundPlayer and ofFmodSoundPlayer? my problem with those two is that they load the files and convert them in wav automatically in the heap and this creates long loading times along with many other issues…

If you’re on os x and dont mind losing platform independence, it should be pretty staright forward to do this with core audio maybe. AudioQueues should do it, but may be a bit too low level. I havent used them myself but for most of the core audio stuff i find the docs are pretty good and theres usually example code either from apple or just floating round

hey p thanks for the feedback

nah, it was very crucial to maintain the cross-platform ability for this but anyway I solved it with a more complicated solution than just merging the sounds.

I created a class called: ofxPlaylist and added an append(ofQTplayer) function… a load fuction a loadAllFilesInFolder function and then used a stl::vector inside that holds the sounds/videos etc and automatically manages it as a single flie. it’s actually better than just merging the sounds because that takes a very long time. (i tried that) this is faster and it makes no difference whatsoever for your code it’s like having a single file:

I even added a function that returns the overall size /duration of the entire playlist and current frame . and a setPosition function

it generally behaves like if the all the audio video tracks were merged in one. So I called it a day.