Audio recorded is echoing in mac app using Apple Sample

前端 未结 2 2064
清歌不尽
清歌不尽 2020-12-12 02:58

I need to implement audio recording feature in my mac app.i am using the Apple sample

http://developer.apple.com/library/mac/#samplecode/AudioDataOutputToAudioUnit/L

相关标签:
2条回答
  • 2020-12-12 03:24

    From the description of the sample code:

    The built application uses a QTCaptureSession with a QTCaptureDecompressedAudioOutput to capture audio from the default system input device, applies an effect to that audio using a simple effect AudioUnit, and writes the modified audio to a file using the CoreAudio ExtAudioFile API.

    From CaptureSessionController.m:

    /* Create an effect audio unit to add an effect to the audio before it is written to a file. */
        OSStatus err = noErr;
    
        AudioComponentDescription effectAudioUnitComponentDescription;
        effectAudioUnitComponentDescription.componentType = kAudioUnitType_Effect;
        effectAudioUnitComponentDescription.componentSubType = kAudioUnitSubType_Delay;
    

    It looks like this delay is intentional, as part of the demo.

    0 讨论(0)
  • 2020-12-12 03:40

    Well I found the answer myself.Just need to comment

    effectAudioUnitComponentDescription.componentSubType = kAudioUnitSubType_Delay;
    

    From CaptureSessionController.m:

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