小编Pes*_*lly的帖子

单击应用程序间音频录制期间

我一直试图在iOS 9上的应用程序间音频会话期间录制我的输入.扬声器输出听起来很好,但录制的文件有节奏的咔嗒声.波形如下所示......

在此输入图像描述

我已经调整了我能想到的每个设置和参数,似乎没有任何工作.

以下是格式设置(流设置相同)...

    AudioStreamBasicDescription fileFormat;
fileFormat.mSampleRate          = kSessionSampleRate;
fileFormat.mFormatID            = kAudioFormatLinearPCM;
fileFormat.mFormatFlags         = kAudioFormatFlagsNativeFloatPacked;
fileFormat.mFramesPerPacket     = 1;
fileFormat.mChannelsPerFrame    = 1;
fileFormat.mBitsPerChannel      = 32;       //tone is correct but there is still pops
fileFormat.mBytesPerPacket      = sizeof(Float32);
fileFormat.mBytesPerFrame       = sizeof(Float32);
Run Code Online (Sandbox Code Playgroud)

这是流设置......

        //connect instrument to output
AudioComponentDescription componentDescription = unit.componentDescription;
AudioComponent inputComponent = AudioComponentFindNext(NULL, &componentDescription);
OSStatus status = AudioComponentInstanceNew(inputComponent, &_instrumentUnit);
NSLog(@"%d",status);
AudioUnitElement instrumentOutputBus = 0;
AudioUnitElement ioUnitInputElement = 0;

    //connect instrument unit to remoteIO output's input bus
AudioUnitConnection connection;
connection.sourceAudioUnit = _instrumentUnit;
connection.sourceOutputNumber …
Run Code Online (Sandbox Code Playgroud)

audio objective-c core-audio avfoundation ios

4
推荐指数
1
解决办法
139
查看次数

冒号在C函数中表示什么?

叫做结肠的这种用法是什么?

以下代码摘自Learn Core Audio一书.

    int main(int argc, const char * argv[])
    {
    //...

    cleanup:
        AudioQueueDispose(queue, true);
        AudioFileClose(player.playbackFile);

        return 0;
    }
Run Code Online (Sandbox Code Playgroud)

c colon

1
推荐指数
1
解决办法
466
查看次数

标签 统计

audio ×1

avfoundation ×1

c ×1

colon ×1

core-audio ×1

ios ×1

objective-c ×1