context: new to OF. iOS app using xcode. graphics and touch controls work fine, trying to set up audio.
I try to play an mp3 file with an ofSoundPlayer, it works the first time, and then does nothing every subsequent time.
I’ve compiled the soundplayer example and that works fine, but doing the same things in this existing project fails.
I’ve commented out everything else so what’s happening is just this:
…and the behaviour’s unchanged. Tried various permutations with no effect - multiplay off, setting volume after each play, loading the file again for each play, using ofxOpenALSoundPlayer instead of just ofSoundPlayer.
I had a similar problem. try to get the develop-branch from github as it contains some fixes for ofSoundPlayer.
If you already cloned openFrameworks via git clone you do it like this:
git pull origin develop
Sounds frustrating. I’ve seen quite a few bugfixes around sound in iOS, but I think it’s working pretty well now. The big one I know of is https://github.com/openframeworks/openFrameworks/issues/863 but even that is fixed. Could you post up some more of your code so I could maybe try to debug it a bit?
Experimenting with the soundplayerexample project, I’ve deduced that this is a problem with mp3 files. The “.caf” files that come with the example work fine. Plus I’m getting this output now: “error, cannot get position on mp3s in openAL”, “error, cannot set multiplay on mp3s in openAL”.
So it’s pretty annoying but I guess I can work around it. =/