Currently working on audio units to create a sound system for a game . What i exactly want is
- i have to play 3 sounds simultaneously
- Should be able to control pitch and volume for each sound individually
- then playback this sound combination in mixer accordingly..
Any one have any idea with audio units can guide me in right direction...what structure of AUGRAPH should i follow ?
EDIT:-
After working on this while reading from apple developer library on Audio Units i made a start now m getting runtime errors while setting input stream for 3dmixer unit in ipad(ios). m getting this exception :- exception 'NSInternalInconsistencyException', reason: 'Error setting property format 3d input 0.'
AudioStreamBasicDescription audioFormatnew;
audioFormatnew.mSampleRate = 44100.00;
audioFormatnew.mFormatID = kAudioFormatLinearPCM;
audioFormatnew.mFormatFlags = kAudioFormatFlagsAudioUnitCanonical;
audioFormatnew.mFramesPerPacket =
1;
audioFormatnew.mChannelsPerFrame = 2; // 1 for mono and 2 for stereo
audioFormatnew.mBitsPerChannel = 16;
audioFormatnew.mBytesPerPacket = 4;
audioFormatnew.mBytesPerFrame = 4;
err = AudioUnitSetProperty(mixer3d_1_unit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
0,
&audioFormatnew,
sizeof(audioFormatnew));
NSAssert(err == noErr, @"Error setting property format 3d input 0.");
The mixer3d_1_unit subtype is kAudioUnitSubType_AU3DMixerEmbedded. Can anyone suggest where m doing wrong or provide me with some sample code for 3dmixer unit for IOS specifically.
Thanks