- Home /
Error Initializing AudioSession(errNO:1768843636)
I am getting the following error when returning from using the iPhoneUtils.PlayMovie() method. The background music that had been playing before beginning the movie does not resume.
Error Initializing AudioSession(errNO:1768843636)
$$anonymous$$ORE INFO:
This issue is continuing to occur whenever playing a movie and returning to the application. The music which is paused for the movie never resumes, but other menu related sounds work fine after the movie has ended.
$$anonymous$$ORE INFO: There is more information about this issue here: http://forum.unity3d.com/threads/62370-$$anonymous$$usic-stops-playing-when-returning-from-video-(Unity-3.0-iPhone-Advanced)
$$anonymous$$ORE INFO:
I have noticed another strange bug when playing non-compressed audio as well.
During normal game play there can be up to 4 non-compressed audio files playing plus 1 compressed background sound track which plays the duration of game play. I have noticed that on occasion Unity will skip playing one of the non-compressed sounds.
The non-compressed sounds are played using the PlayOneShot method on an AudioEmitter, and it is usually the same clip played multiple times for a gun shot. It seems that sometimes it will play 4-5 straight with no issue, other times it will skip playing one
I'm going to bump this as I am having a similar issue.
I make use of iPhoneUtils.Play$$anonymous$$ovie in Scene A, then AudioSource.Play in Scene B and get the dreaded error:
force accelerometer registration -> applicationDidBecomeActive() -> moviePreloadDidFinish() -> moviePlayBackDidFinish() Error initializing AudioSession(errNO:1768843636
Answer by Andrius Kuznecovas · Dec 09, 2010 at 12:33 PM
Could you please submit a bug report with a project and post a bug case number. It something specific that I can't reproduce with my project. Thanks!
Andrius Kuznecovas QA Engineer
Answer by chrstopherbrown · Nov 22, 2010 at 05:43 PM
C&P from my response to your thread on the Unity forums:
So...I've found a (partial?) solution to [i]my[/i] problem. I am building to iOS. My original audio clips were imported from mp3. Originally, I had 3D Sound, Decompress On Load, and Hardware Decoding toggle ON. When I went back to the audio clip for my button sound, turned Decompress On Load OFF, I still generate the AudioSession error code, but my application [i]does not[/i] crash.
Answer by Geoff Coope · Jan 04, 2011 at 03:31 PM
I tried Christopher Browns code from the forum which didnt work for me (music did not resume) unless I supplied the AudioSource before .audio.Play()
e.g.
public void OnApplicationPause( bool pause) {
if(pause == true)
{
time = bgMusicSource.audio.time;
bgMusicSource.audio.Pause();
}
else
{
bgMusicSource.audio.time = time;
bgMusicSource.audio.Play ();
}
}
This works and resumes the music from any resuming state (e.g. home button or call) but you still get the error in the XCode console. Infact you dont need to Pause() or Stop() the music as the iPhone does that itself ?!?, you just need to play it again.
if pause is false (which is a resume) the error occurs regardless of any code (even no code). so its something to do with how Unity or iOS stops the music automatically in the first place that I guess causes the error.
This is with a native WAV, no 3D Sound, Decompress on load not ticked using latest Unity iPhone basic as of this date. I also generate the gameObject, AudioSource and AudioClip (from resources) at runtime.
After searching google it seems that other iOS deveopers can get this error. One suggestion was that the AudioSessionInitialize is being called in the wrong place or more than once in the apps lifetime. $$anonymous$$aybe Unity could look into this?
Answer by bman · Jan 24, 2011 at 04:05 AM
I also have this problem, but when I comment "bNeedToRestoreIPhoneAudioSession = true;" on applicationWillEnterForeground method in AppController file, it works and resume music when I resume the application. But I'm not sure is this right?
and sometimes will get log: MP _playbackInterruptionDidEndNotification :: NSConcreteNotification 0xaab0a0 {name = AVController_PlaybackInterruptionDidEndNotification; object = ; userInfo = { "AVController_InterruptionStatusNotificationParameter" = "non-resumable.SoloAmbientSound"; "AVController_InterruptorNameNotificationParameter" = "AudioSession-4241"; }}, _state = 0
test on iPod3 32g + iOS 4.2.1 + iPhone SDK 4.2 + Unity 3.1.0f4(55865)
Your answer
![](https://koobas.hobune.stream/wayback/20220613074333im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Flipping textures 0 Answers
Unity3 beta, iPhone publishing 3 Answers
Does Unity3 iOS support all generations of iPod/iPhone? 2 Answers
FMOD failed to initialize ... Error initializing output device. 2 Answers