I’m having a serious problem when trying to play a sound after I run a .m4v via the iPhones MPMoviePlayerController player. Up until I play the movie everything works well. But afterwards I can’t get any sounds from FMOD.
The last line of the logs report "FMOD: SystemI::createSoundInternal : done. OpenState now = FMOD_OPENSTATE_READY.".
The logs for both before and after I play the movie are identical. The only difference is that the BEFORE the movie playback I get this after the sound:
FMOD: SoundI::release : (null) (0x798d760)
FMOD: SoundI::release : remove stream samples. (0x798d760)
FMOD: SoundI::release : (null) (0x79ac4b0)
FMOD: SoundI::release : free this. (0x79ac4b0)
FMOD: SoundI::release : done (0x79ac4b0)
FMOD: SoundI::release : release codec. (0x798d760)
FMOD: Codec::release :
FMOD: Codec::release : Close file (mFile = 0x6c69960)
FMOD: Plugin::release : (0x792f070)
FMOD: Plugin::release : done
FMOD: Codec::release : done
FMOD: SoundI::release : free this. (0x798d760)
FMOD: SoundI::release : done (0x798d760)
But AFTER the movie playback it stops at "FMOD: SystemI::createSoundInternal : done. OpenState now = FMOD_OPENSTATE_READY.".
Can someone please help?
- doldis asked 8 years ago
I have just done some tests here and I think I can see what the problem is.
When the movie starts FMOD receives a callback telling it that something else is taking over audio for a while, this is the same as when a call comes in or an alarm goes off. Unfortunately the media player doesn’t seem to be playing nice and notifying us when it is complete, which seems like a bug to me.
I have posted a message on the Apple developer forums to see if I can get some clarification, I may escalate it to a bug report if we don’t get useful results soon.
For now as a workaround all I can suggest is shutting down FMOD and reinitializing when the movie is complete. It’s a bit of a hack, but it should force the audio back again.
I’m working with doldis on the same iphone project and we are still having issues with playing audio after we play a video through the MPMoviePlayerController.
We have tried shutting down and re-initializing fmod before/after playback but this has not solved the problem.
Recently I’ve upgraded us to the 4.23.01 development build of FMod. Using this build we are able to see an error message when we try to initialize (using previous builds initialization always succeeded but then audio would fail to play). Here is the error message we see now:
FMOD: OutputCoreAudio::init : Initializing…
FMOD: OutputCoreAudio::init : Cannot initialise audio session. (err: 1768843636)
FMOD: OutputCoreAudio::init : Initialization Failed!
Please let me know if there is anything that I can do to assist you in troubleshooting this issue, it is my #1 priority as not having audio after cutscenes is the only thing holding our project milestone up at this point.
Thank you for your help,
- elanz answered 8 years ago
I understand this is a critical issue for you so I have created a test case here using the Apple movie player example. The strategy I described above is solid except, as you say the System::init() error is causing grief. I have found and fixed the problem on our end and I have tested re-initing FMOD via the movie player finish callback and all works well.
Unfortunately Apple have not addressed the actual bug in their movie player or even responded to my bug report so for now this hack is the preferred workaround.
The fix will be available in our next release which should be towards the end of the week. If it is super critical you have this resolved before that time please e-mail firstname.lastname@example.org and we can arrange a version for you.
Please login first to submit.