Updating AUBD on the fly...
Updating AUBD on the fly...
- Subject: Updating AUBD on the fly...
- From: Mark Coniglio <email@hidden>
- Date: Thu, 23 Mar 2006 13:09:15 -0500
I am receiving an kAudioUnitErr_PropertyNotWritable error when
attempting to change the ASBD of an AUAudioFilePlayer when the
AUGraph that contains it is running.
I would like to know if it is possible to set the ASBD of a
non-playing AUAudioFilePlayer within a running AUGraph. Obviously I
can restart the graph, but this causes other files that are
currently playing to start over from the beginning.
Background:
In my program, the user can change the audio file being played by a
AUAudioFilePlayer while the graph is running. Each file player has an
AUConverter between its output and the next input, so that I can
standardize number of inputs, sample rate, number of channels, etc.
Before attempting to change the files, I do the following:
- Stop playing the current file by calling AudioUnitReset on the
AUAudioFilePlayer's output
- Call AudioUnitReset on the input to the AUConverter
- Call AudioFileClose on the output of the AUAudioFilePlayer
Then I start initializing the AUAudioFilePlayer to play the new file.
The problem occurs when the user switches from a stereo to a mono
file. In this case, I am attempting to set the output format of the
AUAudioFilePlayer, by changing the mChannelsPerFrame from 2 to 1.
Then I call
AudioUnitSetProperty(audioUnit, kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output, 0, &auFormat, propSize);
This exact same code works when after calling AUGraphOpen but before
any connections are made, and before calling AUGraphInitialize and
AUGraphStart.
It does not work if the graph is running, even if I disconnect all of
the inputs and outputs to the AUAudioFilePlayer and AUConverter and
reset them both.
Any ideas?
Best Wishes,
Mark
--
=====================================================================
Mark Coniglio, Artistic Co-Director | email@hidden
Troika Ranch Dance Theater | http://www.troikaranch.org
=====================================================================
_______________________________________________
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