I’m having problems to get ofSoundPlayer play RAW sound files.
I have tried with different raw files, getting with the most of them no audio and with one of them a distorted output.
I have prepared two application examples:
the first called noise should reproduce a noise sound, but you get the distorted result. noise
the second called brush should reproduce a rhythmic pattern but you get no sounds. brush
the code is very simple, I used one example and just modified the sound path and the name of the synth variable into raw.
Anyone has suggestions about where should I look to fix this?
Thanks!
I think I understand why you are having this problem.
Unlike a mp3 or wav raw doesn’t store any information that can describe its format. So when you load the sound you need to explicitly state that you are loading a raw file. You could pass the FSOUND_LOADRAW flag - to the Fmod CreateSound function in ofSoundPlayer - but this would most likely mean you wouldn’t be able to load mp3 or wav files in other projects.
If you want I can code a hack for you for ofSoundPlayer - but maybe the easiest is just to convert the files to Wav?
I need the files to be raw as I’m building an app that takes a picture with a camera, saves it in raw format and then loads it as a sound and play it back.
It’s the same idea of making an image in photoshop, saving it as a raw file, then open audacity, load the image in audacity as raw data and play it back as a sound.