quickly, I think you are missing “ofxALSoundPlayer.cpp” from the project. you likely have the .h file, but not the .cpp file, so the code is compiling Ok, but failing on link (ld). Check to make sure that you have the addon src code included, in addition to the includes.
I’ve tried to import the addon in a project made from scratch and i’ve the same problem, it says that could not find the addon, but i tried to import it from one of the examples provided in the OF for iphone package and it works great for me.
Someone know why it works with one of the examples provided and not for projects made by yourself??
If you’re using XCode you’ll need to make sure that both the h and cpp files are included in the project. I haven’t touched the iPhone stuff so I don’t know if you also need to muck around with the path settings, but I wouldn’t imagine so. Like Zach says, check that the file structure in your app matches that of the addon example, i.e. that all the same files are being included.
Also, if need be I suppose you could just drop it in the src folder of your application, but you shouldn’t have to do that.
there isnt any complicated path stuff…
it’s just 4 files you need to include
(the ofxAlSoundPlayer files and the soundEngine files)
the only other thing you need to do is go down to libs/core/core frameworks/ and right click. Select ‘add existing framework’ and pick OpenAL.framework
I finally compiled the project without errors, and i’ve converted an .mp3 file to .caf format like is indicated in the addon files but i can’t hear anything.
Someone knows what happens if compile and runs correctly??
2.- To convert any audio file to something that the iPhone can play, this will do the trick. In terminal:
afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf
(From http://stackoverflow.com/questions/254080?sort=newest)
thanks for the excellent ofxALSoundPlayer class - it worked perfectly out the box!
( I hooked it up for this little dj app I made: http://vimeo.com/4353898 )
One thing I couldn’t find in it though a setPosition function - as in set the playback position within the track - ie setPosition(0.5) ( jump to half way through ).
Is that something that is missing from the SoundEngine class hence ofxALSoundPlayer?
should get you rolling down the right path. I can currently get 2 stereo channels with mixing and low pass filters going without any problems. Once I get up past that, I run into speed issues (probably due to the fact that I am using floats instead of fixed point math), but that is a problem for a smarter person than me.
theo- yeah thats exactly it. I havent gotten around to really digging into soundEngine yet. it seems pretty complicated.
I did add a function to import sounds from arrays, so I’m starting to understand what’s going on in soundEngine, but thats as far as I’ve gotten. I definitely want to add position information soon though
For those of you that have it working, can you post a caf file that you know works? I followed the guide, added the framework, renamed the cpp to mm, etc. The console shows the sound engine being initialized but I can’t hear anything. No errors are thrown either when I try playing the file.
I’m trying to get this to work as part of a class, but even without that I hear nothing.
I’ve tried putting in an incorrect file name just to make sure that it’s finding the file prooperly, and that definitely throws errors. Any ideas? I’ve tried a few caf files (converting aifs from terminal) but no luck thus far.