avaudiorecorder

iphone - AVAudioRecorder gives mono playback (sound playing in just one channel)

爱⌒轻易说出口 提交于 2019-12-08 05:01:07
问题 I am using AVAudioRecorder to record audio and save to a wav file (using SDK 3.0) The settings dictionary contains the following values NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; [recordSetting setValue :

AVAudioRecorder not saving recording

为君一笑 提交于 2019-12-08 04:03:52
问题 I am making an iOS game. One of the things I need to do is to allow the user to make a quick little audio recording. This all works, but the recording is only temporarily saved. So when the user closes the app and reopens it, the recording should be able to play again, but it doesn't, it gets deleted when I close the app. I don't understand what I am doing wrong. Below is my code: I setup the AVAudioRecorder in the ViewDidLoad method like this: // Setup audio recorder to save file. NSArray

How to display audio meter on an iPhone [duplicate]

淺唱寂寞╮ 提交于 2019-12-07 18:46:21
问题 This question already has an answer here : How to measure noise or sound and displays in dB(A) in iphone? (1 answer) Closed 6 years ago . I have an audio recorder and I was wondering if anyone has a code to show a audio meter (the bar that most of audio recorders have which shows the level of input audio). 回答1: Apple's SpeakHere example code includes a LevelView class which seems to be exactly what you are looking for. 回答2: Heres an example that calculates output and prints it: - (void

Can AVAudioRecorder be used to record audio coming from your iOS app?

好久不见. 提交于 2019-12-07 10:06:00
问题 I'd like to record the audio coming from my iPhone app. So after the background music and sound effects are mixed I'd like to sample the audio before it's played from the device's speakers (or headphones). I've been experimenting with RemoteIO Audio Units. These seem promising. However they're pretty low level. Can AVAudioRecorder (or other "high-level" object) be used to capture audio coming from an iOS device? 回答1: As far as I can tell, there's no way to do this with AVAudioRecorder. You

Sending AVAudioRecorder to server iOS

喜夏-厌秋 提交于 2019-12-07 05:40:02
问题 I am trying for the past few days to upload a locally saved sounde record to a server (which handels it with a php file and saves it to the server). the problem is that I can't find a way to do that. While recording the sound (AVAudioRecorder) it saves at a "NSTemporaryDirectory()": NSURL *temporaryRecFile = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"VoiceFile"]]]; Now, everywhere I checked the answer was to use ASIHTTPRequest.

iphone - AVAudioRecorder gives mono playback (sound playing in just one channel)

三世轮回 提交于 2019-12-06 15:51:29
I am using AVAudioRecorder to record audio and save to a wav file (using SDK 3.0) The settings dictionary contains the following values NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; [recordSetting setValue :[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey]; [recordSetting setValue :[NSNumber

Converting NSData back to Audio File

五迷三道 提交于 2019-12-06 14:10:37
i have converted my .caf audio file to NSData object using the following line of code: NSData *audioData = [NSData dataWithContentsOfFile:[MyRecorderFilePathURL path] options: 0 error:&err]; I am doing so to upload the binary object to a server through a web service. How do i convert audioData back to a .caf file which can be played using AVAudioPlayer ? AVAudioPlayer has a method for playing sound from NSData object . You can use - (id)initWithData:(NSData *)data error:(NSError **)outError method of AVAudioPlayer 来源: https://stackoverflow.com/questions/9157916/converting-nsdata-back-to-audio

How to convert .caf Audio file into .mp4 file in swift

喜夏-厌秋 提交于 2019-12-06 13:32:54
I'm recording audio using device microphone with AVAudioRecorder which return file in .caf format that is playable only in Apple devices but not on Android devices. Since Apple is not supporting .mp3 file so I want to convert it in .mp4 format before uploading to server. Is .mp4 is good for audio only? Can I convert it with AVAssetExportSession ? Following is audio recorder code: func setupAudioRecorder () { let fileMgr = FileManager.default let dirPaths = fileMgr.urls(for:.documentDirectory, in:.userDomainMask) let soundFileURL = dirPaths[0].appendingPathComponent("myaudio.caf") let

AVAudioRecorder normalize volume

会有一股神秘感。 提交于 2019-12-06 04:56:06
问题 I've got an app that records audio. I'm wondering how I can increase the gain. is there a way to normalize the audio or amplify it somehow? thanks, howie 回答1: Looks like I found a solution. According to the documentation the AVAudioPlayer volume can be between 0.0 and 1.0. Apparently it can be set to a value greater than 1.0. By increasing the volume I was able to achieve the same desired result. While it's not normalized, the gain is increased. 回答2: #import <AudioToolbox/AudioServices.h>

How to display audio meter on an iPhone [duplicate]

丶灬走出姿态 提交于 2019-12-05 21:37:16
This question already has an answer here: How to measure noise or sound and displays in dB(A) in iphone? 1 answer I have an audio recorder and I was wondering if anyone has a code to show a audio meter (the bar that most of audio recorders have which shows the level of input audio). Jonah Apple's SpeakHere example code includes a LevelView class which seems to be exactly what you are looking for. Heres an example that calculates output and prints it: - (void)viewDidLoad { [super viewDidLoad]; NSURL *url = [NSURL fileURLWithPath:@"/dev/null"]; // Your audio save path NSDictionary *settings =