• 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
Audio MixerUnit output writing problem.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Audio MixerUnit output writing problem.


  • Subject: Audio MixerUnit output writing problem.
  • From: JongYoung Park <email@hidden>
  • Date: Wed, 30 Dec 2009 13:30:29 -0600

Hello, Lists members.

I'm making sound mixing program in iPhone based on Apple mixer sample.
(iPhoneMultichannelMixerTest)
(Link : http://developer.apple.com/iphone/library/samplecode/iPhoneMultichannelMixerTest/index.html)

I want to make a file from mixer output, - Mixed sound from AUGraph- so I tried find infos in mailing list.

My conclusion was that I need something more to get result correct.

1. Make render callback for saving - using ExtAudioFileWrite - 
2. Change final output unit from kAudioUnitSubType_RemoteIO to kAudioUnitSubType_GenericOutput.
3. Set render callback that I made before(1 step) to the kAudioUnitSubType_GenericOutput.
 (ex. 
AURenderCallbackStruct rcbs2;
rcbs2.inputProc = &renderOutput;
rcbs2.inputProcRefCon = mSoundBuffer;

OSStatus rst = AudioUnitSetProperty(mOutput, 
 kAudioUnitProperty_SetRenderCallback, 
 kAudioUnitScope_Output, 
 0, 
 &rcbs2, 
 sizeof(rcbs2));

)
4. Call AudioUnitRender to work AUGraph flow. (Can't use AUGraphStart() because it did not happen nothing)
OSStatus rst = noErr;

int FRAMES = 512;
//  render settings
AudioTimeStamp timestamp;
timestamp.mSampleTime = 0;
timestamp.mFlags      = kAudioTimeStampSampleTimeValid;
AudioBufferList bufferList;
bufferList.mNumberBuffers = 1;
bufferList.mBuffers[0].mNumberChannels = 1;
bufferList.mBuffers[0].mDataByteSize = FRAMES * 1 * sizeof (float);

while (1) { // only for Test
AudioUnitRenderActionFlags flags = 0;
result = AudioUnitRender(mOutput,
&flags,
&timestamp,
0,
FRAMES,
&bufferList);
if (result) { printf("AURender result %d X %4.4s\n", result, result, (char*)&result); return; }
}

......

But unfortunately I received -50 error from AudioUnitRender function.

From here, my questions start.

1. Is my approach is correct to write a file from AUGraph?

2. If it is not, is there best way to get a result?

3. Can you give me a hint with sample code?

Thank you for reading.

-Abraham P.-

say, /i:badak/

http://www.ebadaq.com

 _______________________________________________
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: Trying to so something that *should* be straightforward...
  • Next by Date: bastardizing AUEventListenerNotify() no longer working?
  • Previous by thread: Trying to so something that *should* be straightforward...
  • Next by thread: bastardizing AUEventListenerNotify() no longer working?
  • Index(es):
    • Date
    • Thread