Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
550 views
in Technique[技术] by (71.8m points)

cocoa touch - Audio recorded is echoing in mac app using Apple Sample

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/Listings/main_m.html. Everything is working fine .The only issue is that the audio file created is echoing while playing.Please help!Later I checked, Apple sample also has the same problem

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...