• 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: Updating AUBD on the fly...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating AUBD on the fly...


  • Subject: Re: Updating AUBD on the fly...
  • From: William Stewart <email@hidden>
  • Date: Thu, 23 Mar 2006 11:03:14 -0800


On 23/03/2006, at 10:09 AM, Mark Coniglio wrote:

I am receiving an kAudioUnitErr_PropertyNotWritable error when attempting to change the ASBD of an AUAudioFilePlayer when the AUGraph that contains it is running.

More correctly, you will be getting this error because the AU is Initialised, and it is rejecting a format change while it is in that state.


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.

This issue is discussed in the AU Docs (formats and Initialised state).

Bill


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

--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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: 
 >Updating AUBD on the fly... (From: Mark Coniglio <email@hidden>)

  • Prev by Date: Re: AUAudioFilePlayer + AUTImePitch in AUGraph problems
  • Next by Date: Question about error code returned by AUGraphStart
  • Previous by thread: Updating AUBD on the fly...
  • Next by thread: Question about error code returned by AUGraphStart
  • Index(es):
    • Date
    • Thread