我用AVAudioRecorder
它来录制,它在iOS 4设备上运行良好,但昨天我们发现录制在iOS5上被破坏了.使用iPhone 5模拟器我收到以下错误:
2011-08-02 11:09:03.586 Moodle [7832:10103]加载/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:dlopen(/ System/Library /扩展/ AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,262):找不到符号:___ CFObjCIsCollectable
你知道这个错误来自何处以及如何解决这个问题?
我正在使用AVAudioRecorder添加语音备忘录功能,我需要知道录音机录制语音的最佳设置.
不幸的是,我对音频一无所知,甚至不确定google的条款.
目前,我正在使用以下内容从某处复制以进行测试:
recorderSettingsDict=[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInt:kAudioFormatAppleIMA4],AVFormatIDKey,
[NSNumber numberWithInt:44100.0],AVSampleRateKey,
[NSNumber numberWithInt: 2],AVNumberOfChannelsKey,
[NSNumber numberWithInt:16],AVLinearPCMBitDepthKey,
[NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey,
[NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey,
nil];
Run Code Online (Sandbox Code Playgroud)
要么:
defaultSettings = {
AVFormatIDKey = 1768775988;
AVLinearPCMBitDepthKey = 16;
AVLinearPCMIsBigEndianKey = 0;
AVLinearPCMIsFloatKey = 0;
AVNumberOfChannelsKey = 2;
AVSampleRateKey = 44100;
};
Run Code Online (Sandbox Code Playgroud)
这有效,但我不知道它在质量,速度,文件大小等方面是否适合语音.
该AVAudioRecorder类参考列出许多设置的常量,但我不知道那些使用语音其中.
如果有人知道一个好的"AudioFormats for Dummy"资源,我也会这样做.(注意:我已经浏览过Apple Docs,他们假设我没有数字音频知识库.)
我正在使用AVAudioRecorder录制音频,如我如何使用AVAudioRecorder在iPhone上录制音频?
然后我使用AVAudioPlayer播放录音.然而,声音是从耳机发出的,而不是扬声器.我如何将声音重定向到扬声器?
TIA!
我正在使用下面提到的链接通过我的iPhone应用程序录制音频:
如何使用AVAudioRecorder在iPhone上录制音频?
当我尝试在我的设备上使用AVAudioPlayer播放我的录音时,我看到即使设备音量已满,录音的音量也非常低.
录音工作正常.
可以做些什么来增加音量?
我在使用AVFoundation框架时遇到了一些问题.我用iOS 6编写了一个演示应用程序来录制音频,播放和计算分贝.它既可以使用iOS模拟器内置的xcode 4.6.3,也可以使用我的iPhone和iOS 6.1.3
现在我将xcode更新到版本5并再次测试了appa.使用内置模拟器(适用于iOS 6.1和iOS 7模拟器).但是当我使用iOS 7.0将应用程序部署到我的iPhone时,它不再起作用了.
我正在使用AVAudioRecorder
和AVAudioPlayer
.
我不知道会出现什么问题.有什么建议?谢谢!
我正在使用AVAudioRecorder录制来自iphone麦克风的音频,但我想丢弃静音期:在检测声音时开始录音,在下次静音时停止录音.
无法弄清楚如何做到这一点
有什么建议?
感谢名单!
我想知道我何时AVAudioRecorder
无法进入(例如音乐开始播放时).
正如audioRecorderEndInterruption
将在iOS 9中弃用的那样,我专注于AVAudioSession
中断通知(但两者都没有按预期工作).
问题是,如果应用程序在中断发生时仍然在前台,则永远不会调用中断通知.
例如:用户启动和停止播放音乐而不将应用程序移动到后台.
要检测我正在使用的任何中断:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioSessionWasInterrupted:) name:AVAudioSessionInterruptionNotification object:nil];
...
- (void)audioSessionWasInterrupted:(NSNotification *)notification {
if ([notification.name isEqualToString:AVAudioSessionInterruptionNotification]) {
NSLog(@"Interruption notification");
if ([[notification.userInfo valueForKey:AVAudioSessionInterruptionTypeKey] isEqualToNumber:[NSNumber numberWithInt:AVAudioSessionInterruptionTypeBegan]]) {
NSLog(@"InterruptionTypeBegan");
} else {
NSLog(@"InterruptionTypeEnded");
}
}
}
Run Code Online (Sandbox Code Playgroud)
我InterruptionTypeBegan
按预期得到了,但InterruptionTypeEnded
如果应用程序仍在前台,则不会被调用(意味着在将应用程序放置在后台并返回到前台之前不会调用它).
InterruptionTypeEnded
当应用程序在前台时发生中断时,我如何收到通知?
在我正在开发的应用程序中,我或多或少地碰到了一堵砖墙.在应用程序中,您可以输入一个视图,该视图在标准表视图中列出所有本地保存的音频文件.从这里你可以点击它们来播放它们,或者点击下面的录制按钮进行新的录制,之后会自动保存到应用程序沙箱中.
现在所有这些在大多数情况下实际上都非常好.我可以坐下来录制并播放它们.我可以坐下来测试一下这个45左右,没有任何问题.然后突然在随机的时候我会遇到一个非常奇怪的问题.问题是,无论录制多长时间,录音机都会突然开始保存除了无法播放的损坏文件以及大小正好为4096字节的文件.
我以完全标准的方式使用AVAudioRecorder,设置如下:
// Specific settings for the audio recording
NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin],
AVEncoderAudioQualityKey,
[NSNumber numberWithInt:8],
AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],
AVNumberOfChannelsKey,
[NSNumber numberWithFloat:22000.0],
AVSampleRateKey,
nil];
NSError *error = nil;
audioRecorder = [[AVAudioRecorder alloc]
initWithURL:contentURL
settings:recordSettings
error:&error];
audioRecorder.delegate = self;
Run Code Online (Sandbox Code Playgroud)
我像这样开始录音:
if (!isRecording) {
isRecording = YES;
[audioRecorder record];
// Start the timer
recordTiming = [NSDate date];
timeCheck = [NSTimer
scheduledTimerWithTimeInterval:1.0f
target:self
selector:@selector(timeCheck)
userInfo:nil
repeats:YES];
}
Run Code Online (Sandbox Code Playgroud)
然后用这个来阻止它:
if (isRecording) {
[audioRecorder stop];
// Stop the timer
[timeCheck …
Run Code Online (Sandbox Code Playgroud) 我有一些录音代码正常工作,但录制的音频(来自iPod touch内置麦克风)非常嘈杂.
这是我的配置:
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&err];
if (err) {
NSLog(@"audioSession: %@ %d %@", [err domain], [err code], [[err userInfo] description]);
return;
}
[audioSession setActive:YES error:&err];
err = nil;
if (err) {
NSLog(@"audioSession: %@ %d %@", [err domain], [err code], [[err userInfo] description]);
return;
}
recordSetting = [[NSMutableDictionary alloc] init];
// We can use kAudioFormatAppleIMA4 (4:1 compression) or kAudioFormatLinearPCM for nocompression
[recordSetting setValue:[NSNumber kAudioFormatLinearPCM] forKey:AVFormatIDKey];
// We can use 44100, …
Run Code Online (Sandbox Code Playgroud) 如何在录制时将音频片段实时上传到服务器?基本上我的要求是在录制时将音频剪辑上传为chucks/packets.我已经使用IQAudioRecorderController https://github.com/hackiftekhar/IQAudioRecorderController完成了录制部分.它记录音频并保存到TemporaryDirectory.
我想知道如何在不保存音频片段的情况下实时上传.
这是录音部分
//Unique recording URL
NSString *fileName = [[NSProcessInfo processInfo] globallyUniqueString];
_recordingFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.m4a",fileName]];
// Initiate and prepare the recorder
_audioRecorder = [[AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:_recordingFilePath] settings:recordSetting error:nil];
_audioRecorder.delegate = self;
_audioRecorder.meteringEnabled = YES;
// Recording start
- (void)recordingButtonAction:(UIBarButtonItem *)item
{
if (_isRecording == NO)
{
_isRecording = YES;
//UI Update
{
[self showNavigationButton:NO];
_recordButton.tintColor = _recordingTintColor;
_playButton.enabled = NO;
_trashButton.enabled = NO;
}
/*
Create the recorder
*/
if ([[NSFileManager defaultManager] fileExistsAtPath:_recordingFilePath])
{
[[NSFileManager …
Run Code Online (Sandbox Code Playgroud) avaudiorecorder ×10
ios ×6
iphone ×4
audio ×3
avfoundation ×2
objective-c ×2
cocoa-touch ×1
core-audio ×1
corrupt ×1
interrupt ×1
ios4 ×1
ios5 ×1
ios7 ×1
xcode5 ×1