• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Stereo recording with AVAudioRecorder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stereo recording with AVAudioRecorder


  • Subject: Stereo recording with AVAudioRecorder
  • From: patrick machielse <email@hidden>
  • Date: Fri, 25 Jun 2010 15:44:33 +0200

I'm trying to record some audio on iOS 4 throug the built-in (or external) microphone using AVAudioRecorder. The problem I am having is that the recorded volume for the right channel is always reported as -120 dB (not -160 dB, the documented lowest value). And in fact no audio for the right channel is audible.

I tried this on two devices: an iPhone 3G and an iPod Touch 2G using a plug-in microphone.

When I run the same code in the simulator (finaly audio recording in the simulator, thanks!) the right channel is recorded properly.

Then I tried to find out the number of audio channels supported in hardware as follows:

UInt32 nChannels = 0;
UInt32 size = sizeof nChannels;
OSStatus err = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareInputNumberChannels,
                                       &size,
                                       &nChannels);
if ( noErr != err ) {
    unsigned int myerr = NSSwapBigIntToHost(err);
    char *s = (char *)&myerr;
    NSLog(@"AudioSessionGetProperty returned error: \'%c%c%c%c\'", s[0], s[1], s[2], s[3]);
} else {
    NSLog(@"device has %d channels", nChannels);
}

Again, in the simulator it reports 2 channels, but on both devices the error code 'what' is returned. This code isn't in the Audio Session results code, but it seems to indicate that AudioSessionGetProperty() doesn't know the kAudioSessionProperty_CurrentHardwareInputNumberChannels property on the device.

I'm out of ideas. Am I'm overlooking something basic, or is audio recording (very) buggy?

patrick
--
Patrick Machielse
Hieper Software

http://www.hieper.nl
email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Break audio path
  • Next by Date: Re: How to access the output stream in AUGraph
  • Previous by thread: Break audio path
  • Next by thread: ExtAudioFileWriteAsync causing audio skips
  • Index(es):
    • Date
    • Thread