小编Sam*_*ent的帖子

iOS5效果单元应使用哪种流格式

我正在尝试使用低通滤波器AU.在将流格式设置为过滤器单元时,我不断收到kAudioUnitErr_FormatNotSupported(-10868)错误,但如果我只使用远程IO单元则没有错误.

我正在使用的流格式是(更新的):

myASBD.mSampleRate = hardwareSampleRate;
myASBD.mFormatID = kAudioFormatLinearPCM;      
myASBD.mFormatFlags = kAudioFormatFlagIsSignedInteger;
myASBD.mBitsPerChannel = 8 * sizeof(float);
myASBD.mFramesPerPacket = 1;                                          
myASBD.mChannelsPerFrame = 1;           
myASBD.mBytesPerPacket = sizeof(float) * myASBD.mFramesPerPacket;                                                                            
myASBD.mBytesPerFrame = sizeof(float) * myASBD.mChannelsPerFrame;  
Run Code Online (Sandbox Code Playgroud)

我正在设置过滤器流,如下所示:

 // Sets input stream type to ASBD
 setupErr = AudioUnitSetProperty(filterUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &myASBD, sizeof(myASBD));
 NSLog(@"Filter in: %i", setupErr);

 //NSAssert(setupErr == noErr, @"No ASBD on Finput");


//Sets output stream type to ASBD
setupErr = AudioUnitSetProperty(filterUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &myASBD, sizeof(myASBD));
NSLog(@"Filter out: %i", setupErr);
NSAssert(setupErr == noErr, …
Run Code Online (Sandbox Code Playgroud)

signal-processing core-audio audiounit ios

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

在iOS5中使用滤波器音频单元效果

我正在尝试使用远程IO连接并通过内置过滤器效果(仅限iOS 5)路由音频输入,然后退出硬件.我可以让它从输入直接路由到输出,但我无法让过滤器工作.我不确定它是滤波器音频单元还是路由器我错了.

这个位只是我尝试设置过滤器和更改路由以便数据处理它.

任何帮助表示赞赏.

// ******* BEGIN FILTER ********

NSLog(@"Begin filter");

// Creates Audio Component Description - Output Filter    
AudioComponentDescription filterCompDesc;
filterCompDesc .componentType = kAudioUnitType_Effect;
filterCompDesc.componentSubType = kAudioUnitSubType_LowPassFilter;
filterCompDesc.componentManufacturer = kAudioUnitManufacturer_Apple;
filterCompDesc.componentFlags = 1;
filterCompDesc.componentFlagsMask = 1;


// Create Filter Unit
AudioUnit lpFilterUnit;
AudioComponent filterComponent = AudioComponentFindNext(NULL, &filterCompDesc);
setupErr = AudioComponentInstanceNew(filterComponent, &lpFilterUnit);
NSAssert(setupErr == noErr, @"No instance of filter");

AudioUnitElement bus2 = 2;
setupErr = AudioUnitSetProperty(lpFilterUnit, kAudioUnitSubType_LowPassFilter, kAudioUnitScope_Output, bus2, &oneFlag, sizeof(oneFlag));

AudioUnitElement bus3 = 3;
setupErr = AudioUnitSetProperty(lpFilterUnit, kAudioUnitSubType_LowPassFilter, kAudioUnitScope_Input, …
Run Code Online (Sandbox Code Playgroud)

signal-processing objective-c core-audio audiounit ios

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