我正在开发一个需要声学回声消除的iOS项目,因此kAudioUnitSubType_VoiceProcessingIO子类型似乎是一个不错的选择.以下是我的音频单元说明
//io unit description
AudioComponentDescription ioUnitDescription;
ioUnitDescription.componentType = kAudioUnitType_Output;
ioUnitDescription.componentSubType = kAudioUnitSubType_VoiceProcessingIO;
ioUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
ioUnitDescription.componentFlags = 0;
ioUnitDescription.componentFlagsMask = 0;
Run Code Online (Sandbox Code Playgroud)
根据我对RemoteIO子类型的经验,我启用了输入元素:
UInt32 enable = 1;
AudioUnitSetProperty(ioUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enable, sizeof(enable));
Run Code Online (Sandbox Code Playgroud)
但是,初始化音频图时出错.如果VoiceProcessingIO被RemoteIO取代,则相同的音频图表可以正常工作.
RemoteIO和VoiceProcessingIO之间有什么区别需要特别注意吗?
谢谢,Chuankai
我正在做一个应用程序,它从mediapicker获取歌曲并将其保存到我的应用程序.我想减小文件的大小,但我有一个名为"AACConverter"的样本,我测试应用程序,但它没有减少文件大小.任何人帮助我解决这个问题.
- (IBAction)convert:(id)sender {
if ( ![TPAACAudioConverter AACConverterAvailable] ) {
[[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Converting audio", @"")
message:NSLocalizedString(@"Couldn't convert audio: Not supported on this device", @"")
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:NSLocalizedString(@"OK", @""), nil] autorelease] show];
return;
}
// Initialise audio session, and register an interruption listener, important for AAC conversion
if ( !checkResult(AudioSessionInitialize(NULL, NULL, interruptionListener, self), "initialise audio session") ) {
[[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Converting audio", @"")
message:NSLocalizedString(@"Couldn't initialise audio session!", @"")
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:NSLocalizedString(@"OK", @""), nil] autorelease] show];
return;
}
// Set up an …Run Code Online (Sandbox Code Playgroud) 我有一个程序,它使用文件播放器音频单元来播放,暂停和停止音频文件.我实现这一点的方法是初始化文件播放器音频单元以在零位置播放文件,然后当用户按下暂停按钮时,我停止AUGraph,捕获当前位置,然后使用该位置作为起始位置当用户按下播放按钮时.一切都按照应有的方式工作,但每经过3到4次暂停然后再播放,这首歌就会在我暂停的那一刻开始播放半秒到一秒.
我无法弄清楚为什么会发生这种情况,你们有什么想法吗?这是我的代码的简化版本.
//initialize AUGraph and File player Audio unit
...
...
...
//Start AUGraph
...
...
...
// pause playback
- (void) pauseAUGraph {
//first stop the AuGrpah
result = AUGraphStop (processingGraph);
// get current play head position
AudioTimeStamp ts;
UInt32 size = sizeof(ts);
result = AudioUnitGetProperty(filePlayerUnit,
kAudioUnitProperty_CurrentPlayTime, kAudioUnitScope_Global, 0, &ts,
&size);
//save our play head position for use later
//must add it to itself to take care of multiple presses of the pause button
sampleFrameSavedPosition = sampleFrameSavedPosition + ts.mSampleTime; …Run Code Online (Sandbox Code Playgroud) 如果我在我的应用程序内提供应用内非消费品购买(比如一本书或一首歌),然后在发布后2-3个月我发现我的数字内容有问题,我可以做一个更新数字内容?因此,如果我以1.99美元的价格购买数字文章作为应用内购买并销售了1,000份,那么我意识到我在第3页上遇到了拼写错误.我是否可以上传更新的文章,这些文章会发送给所有人谁买了这篇文章并阻止人们下载旧版本?如果没有,在现实世界中如何处理这种情况?我看过苹果医生,但找不到答案.
编辑:假设我正在使用通过苹果托管内容的新io6功能.
我正在寻找一种方法来改变录制音频的音高,因为它保存到磁盘或播放(实时).我知道音频单元可以用于此.iPhone为音频单元提供有限的支持(例如,据我所知,它不可能创建/使用自定义音频单元),但有几个开箱即用的音频单元可用,其中一个是AUPitch.
我究竟如何使用音频单元(特别是AUPitch)?你不知怎的把它挂进音频队列?是否可以将音频单元链接在一起(例如,同时添加回声效果和音高变化)?
编辑:在检查iPhone SDK标题后(我认为AudioUnit.h,我现在不在Mac前面),我注意到AUPitch被注释掉了.所以它毕竟不像iPhone上的AUPitch.泣 泣
Apple似乎最近在developer.apple.com上更好地组织了他们的iPhone SDK文档 - 现在更难找到对AUPitch等的引用.
也就是说,我仍然对在iPhone上使用音频单元(一般)的质量答案感兴趣.
如何在kAudioUnitSubType_RemoteIO上专门设置音频单元的音量?
我看到kAudioUnitSubType_MultiChannelMixer的东西
status = AudioUnitSetParameter(mixerUnit, kMultiChannelMixerParam_Volume, kAudioUnitScope_Output, AU_OUTPUT_BUS, volume, 0);
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助
我正在使用AUFilePlayer将核心音频加载到混音器单元中,所有内容都很好,但是我无法暂停音乐或将音乐回放到开头.我尝试启动和停止AudioGraph,但一旦播放停止,我就无法重启.我也尝试使用AudioUnitSetProperty将文件播放设置为0
即沿着这些方向的东西:
ScheduledAudioFileRegion rgn;
memset (&rgn.mTimeStamp, 0, sizeof(rgn.mTimeStamp));
rgn.mTimeStamp.mFlags = kAudioTimeStampSampleTimeValid;
rgn.mTimeStamp.mSampleTime = 0;
rgn.mCompletionProc = NULL;
rgn.mCompletionProcUserData = NULL;
rgn.mAudioFile = inputFile;
rgn.mLoopCount = 1;
rgn.mStartFrame = 0;
rgn.mFramesToPlay = nPackets * inputFormat.mFramesPerPacket;
AudioUnitSetProperty(fileUnit, kAudioUnitProperty_ScheduledFileRegion,
kAudioUnitScope_Global, 0,&rgn, sizeof(rgn));
Run Code Online (Sandbox Code Playgroud)
有什么建议?
我有非循环音频,我需要在iPhone/iPod touch上具有与硬件(技术术语)相同的延迟.在一个极端情况下,根据触摸,在一秒钟内顺利播放10-20个样本.
谁是这项任务的王者?OpenAL或远程IO音频单元,为什么?
core-audio ×7
audio ×6
ios ×5
iphone ×5
aac ×1
audiounit ×1
ios5 ×1
itunes ×1
objective-c ×1
voip ×1