Setting properties of an AudioUnit in an AUGraph

Hi,

I am trying to use AUGraph in order to play several sounds mixed together. The sounds are retrieved from a file and stored in memory. According to some sample codes found on the web I made an output node, a mixer node and some generator nodes to provide the input.
The mixer node is connected to the output node and the generator nodes are connected to the mixer node.

For the generator I use as a subtype RemoteIO.

Then I thought (please confirm) that I should tell somehow where the input nodes get their data from, so I tried to define a callback for these input nodes doing the following:

AudioStreamBasicDescription* temp = ... //I tried to print it, the structure contains information from the sound I am trying to play, as expected; err = AudioUnitSetProperty(*generatorUnitTemp, //no error when getting this variable from AUGraphNodeInfo                               kAudioUnitProperty_StreamFormat,                             kAudioUnitScope_Input,                             0,                             temp,                             sizeof(AudioStreamBasicDescription));


generatorUnitTemp is a pointer to the AudioUnit associated to one of my generator node.

When I run this code, I get -50 as an error code. The strange thing is that this code doesn't seem to be referenced in the possible error codes outputted by this function.

Any one has an idea of what this code means and if I did something wrong?

Currently when I try to start the graph, neglecting this error, nothing happen, the callback is not run. (No crash either though)

Also, trying to understand my problem I discovered the CAShow function. Here is what it prints with my graph as parameter:

AudioUnitGraph 0x8E2001:
Member Nodes:
node 1: 'auou' 'genr' 'appl', instance 0xe07600 O I
node 2: 'aumx' 'mcmx' 'appl', instance 0xe48be0 O I
node 3: 'augn' 'rioc' 'appl', instance 0x0
Connections:
node 2 bus 0 => node 1 bus 0
node 3 bus 0 => node 2 bus 0
CurrentState:
mLastUpdateError=0, eventsToProcess=F, isRunning=F

I don't understand what does the reference after "instance" means? is it normal that it is set to 0 for the input node (node 3)?

Thanks

Alexandre

Macbook, Mac OS X (10.5.6)

Posted on Apr 27, 2009 2:52 PM

Reply
5 replies

Apr 27, 2009 3:35 PM in response to Kryten002

Kryten002 wrote:
When I run this code, I get -50 as an error code. The strange thing is that this code doesn't seem to be referenced in the possible error codes outputted by this function.

Any one has an idea of what this code means and if I did something wrong?


All symbolic constants also have a subroutine of the same name. The subroutine returns the error number.

paramErr: -50 paramErr Error in user parameter list

http://support.apple.com/kb/TA22339?viewlocale=en_US
"This happens when copying a file to an MS-DOS-formatted disk or modifying a file on the disk."

Apr 28, 2009 1:23 PM in response to K T

Thanks for your answer.

I forgot to mention that I am developing for the iPhone.

The error you describe seems to be only for MacOS, beside I don't understand how can my problem can be related with the error you describe (I don't do file reading/writing here)

I made some more test over the AudioUnit I got (from AUGraphNodeInfo, without error so I assume I got it)

It seems that AudioUnitGetPropertyInfo and AudioUnitGetProperty are not working either, outputting the same result.

Any one has any idea?

Alexandre

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Setting properties of an AudioUnit in an AUGraph

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.