• 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
Re: Intermittent microphone recording pitch problem, with remoteIO AU
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intermittent microphone recording pitch problem, with remoteIO AU


  • Subject: Re: Intermittent microphone recording pitch problem, with remoteIO AU
  • From: KappA <email@hidden>
  • Date: Tue, 26 Jan 2010 22:21:50 -0500

Hi All,
      I believe I have resolved this. I ended up modifying the AudioStreamBasicDescription struct I used for the Remote IO's outscope/inputbus, as well as the file's client stream format, to use a single channel (now I don't have to divide by 2 anymore), then using the audio converter to use a channelMap to split to 2 channels. Incase it helps others.


Thanks,
Kappa



On Mon, Jan 25, 2010 at 9:11 PM, KappA <email@hidden> wrote:

Hi All,

I am having a mysterious yet intermittent recording problem, where the MIC recording *sometimes* comes out in a higher pitch (sounds like faster sample rate) than it should be. Yet, if I simply restart the application running on my iPhone 3G device, and retry, it seems to record just fine. I am unable to reproduce this problem at will. I suspect that the below code, where I am creating the recording file and setting the client format, is where the problem is coming in. I am using the RemoteIO Audio Unit for playback (chained to the 3DMixer). I am using PlayAndRecord for the audio session category, and when recording from the microphone, I have to divide the sample rate by 2 in order for the playback to sound normal. I don't think this is exactly the right way to do this; however, this works to produce a normal sounding microphone recording that plays back on both channels just fine. In fact, after twiddling with these ASBD structs for a few days, the below is the best I could get things in order for everything to work. Note - recording without MIC works just fine all the time. Any help towards fixing this is greatly appreciated.


AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareSampleRate, &uSampleRateSize, &hwSampleRate);

AudioStreamBasicDescription clientFormat;

memset(&clientFormat, 0, sizeof(AudioStreamBasicDescription));

clientFormat.mSampleRate = hwSampleRate;

clientFormat.mFormatID = kAudioFormatAppleIMA4;

clientFormat.mChannelsPerFrame = 2;

osRet = ExtAudioFileCreateWithURL(recURL, kAudioFileCAFType, &clientFormat, &acl, 0, &m_active_rec_file);

if(osRet) {

CFRelease(recURL);

return false;

}


memset(&clientFormat, 0, sizeof(AudioStreamBasicDescription));

clientFormat.mSampleRate = bEnableMic ? (hwSampleRate/2) : hwSampleRate;

clientFormat.mFormatID = kAudioFormatLinearPCM;

clientFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger|kAudioFormatFlagIsPacked;

clientFormat.mFramesPerPacket = 1;

clientFormat.mChannelsPerFrame = 2;

clientFormat.mBitsPerChannel = 16;

clientFormat.mBytesPerPacket = 4;

clientFormat.mBytesPerFrame = 4;

osRet = ExtAudioFileSetProperty(m_active_rec_file, kExtAudioFileProperty_ClientDataFormat, sizeof(AudioStreamBasicDescription), &clientFormat);

if( osRet != noErr )

{

CFRelease(recURL);

return false;

}


Thanks for the help,

Kappa


 _______________________________________________
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

References: 
 >Intermittent microphone recording pitch problem, with remoteIO AU (From: KappA <email@hidden>)

  • Prev by Date: Re: Input To SubGraph
  • Next by Date: Re: Best approach for a clock source
  • Previous by thread: Intermittent microphone recording pitch problem, with remoteIO AU
  • Next by thread: Input To SubGraph
  • Index(es):
    • Date
    • Thread