iPod mini controls disabled when certain audio session parameters are set

后端 未结 3 2104
无人共我
无人共我 2021-02-18 20:47

I\'m working on a music visualizer for the iPhone/iPad, under iOS 3 you could double-tap the home button and get iPod controls. With the latest version 4.1-4.2, these controls a

相关标签:
3条回答
  • 2021-02-18 21:00

    Well I've given up.. I'm now coding my own UI based off of the AddMusic example code http://developer.apple.com/library/ios/#samplecode/AddMusic/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40008845-Intro-DontLinkElementID_2

    I'm happy to report that play and stop via the MPMusicPlayerController doesn't seem to conflict with the play and record session settings. And building your own play/pause/FF seems to be fairly straightforward

    p.s. I've also discovered that this Music Visualizer app: http://itunes.apple.com/us/app/music-visualizer/id337651694?mt=8 is just this addMusic sample uploaded and this guy is charging 2 bucks for it.. It's got awful reviews.. but it still seems wrong that it's on the app store.

    0 讨论(0)
  • 2021-02-18 21:01

    My iPod touch 4G is running iOS 4.2, and it doesn't have this problem. I would attempt to contact Apple.

    0 讨论(0)
  • 2021-02-18 21:13

    Here's where I've got to so far:

    AudioSessionInitialize(NULL, NULL, NULL, self);
    UInt32  sessionCategory = kAudioSessionCategory_AmbientSound;
    AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
    
    devicetwo = alcOpenDevice(NULL);
    contexttwo = alcCreateContext(devicetwo, 0);
    
        //The following two lines are the lines that gray out iPod controls:
    
    alcMakeContextCurrent(contexttwo); 
    AudioSessionSetActive(YES);
    

    The iPod controls remain grayed out even once the app quits... And removing the two culprit lines of code result in no sound being produced in the app.

    0 讨论(0)
提交回复
热议问题