Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
553 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...