Code Monkey home page Code Monkey logo

Comments (4)

michaeltyson avatar michaeltyson commented on July 18, 2024

Sorry about the delay, Jonatan - Can you reproduce this with the TAAE sample app? I'm having trouble doing so, on iOS 7.0.3 on an iPad 3 WiFi and iPhone 5s.

from theamazingaudioengine.

lijon avatar lijon commented on July 18, 2024

Yes, at least part of the problem happens when I try to stop the audio engine if headphones are unplugged while app is in background. I can reproduce it in the sample app by adding the following to ViewControllers init:

    [audioController addObserver:self
                      forKeyPath:@"playingThroughDeviceSpeaker"
                         options:0
                         context:NULL];

And add the following to the property observer:

    if (object == _audioController && [keyPath isEqualToString:@"playingThroughDeviceSpeaker"]) {
        if(_audioController.playingThroughDeviceSpeaker && [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
                [_audioController stop];

        }
    }

The results:

2013-11-08 16:16:47.418 TheEngineSample[22712:60b] TAAE: Changed audio route to SpeakerAndMicrophone
2013-11-08 16:16:47.422 TheEngineSample[22712:60b] TAAE: Stopping Engine
2013-11-08 16:16:47.595 TheEngineSample[22712:60b] AEFloatConverter.m:76: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:16:47.599 TheEngineSample[22712:60b] AEFloatConverter.m:77: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:16:47.601 TheEngineSample[22712:60b] AEAudioController.m:2585: AudioConverterNew result 1718449215 666D743F fmt?
2013-11-08 16:16:47.603 TheEngineSample[22712:60b] AEAudioController.m:2586: AudioConverterSetProperty(kAudioConverterChannelMap result -50 FFFFFFCE ˇˇˇŒ
2013-11-08 16:16:47.617 TheEngineSample[22712:60b] TAAE: Input status updated (0 channel, non-interleaved)
2013-11-08 16:16:47.624 TheEngineSample[22712:60b] TAAE: Changed audio route to SpeakerAndMicrophone

However, it doesn't explain the errors I get when plugging in the headphones while in background. I can't see that I access anything else in the audioController in that case..

from theamazingaudioengine.

lijon avatar lijon commented on July 18, 2024

Update: Oh, when plugging in the headphones, the errors comes from Audiobus:

2013-11-08 16:21:36.136 AUFX Test[22719:60b] TAAE: Changed audio route to HeadphonesAndMicrophone
2013-11-08 16:21:36.143 AUFX Test[22719:60b] AEAudioController.m:2585: AudioConverterNew result 1718449215 666D743F fmt?
2013-11-08 16:21:36.147 AUFX Test[22719:60b] AEAudioController.m:2586: AudioConverterSetProperty(kAudioConverterChannelMap result -50 FFFFFFCE ˇˇˇŒ
2013-11-08 16:21:36.150 AUFX Test[22719:60b] /ABInputPort.m:243: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:21:36.152 AUFX Test[22719:60b] /ABInputPort.m:245: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:21:36.154 AUFX Test[22719:60b] TAAE: Input status updated (0 channel, non-interleaved)

But it's the same error so I'm quite sure it's related.

from theamazingaudioengine.

lijon avatar lijon commented on July 18, 2024

Another update: doing [_audioController performSelector:@selector(stop) withObject:nil afterDelay:10.0] instead of stopping directly when headphones are pulled works around the problem. It's either a timing issue or a threading issue (perhaps the observer is not called on the main thread?)

from theamazingaudioengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.