• 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
How to change output sampling rate from AU HOST
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to change output sampling rate from AU HOST


  • Subject: How to change output sampling rate from AU HOST
  • From: Nobuyasu Jinnai/神内伸恭 <email@hidden>
  • Date: Sat, 17 May 2003 23:30:01 +0900 (JST)

Dir sir,

Now I am writing a simple AU Host, so I need to change the
sampling rate of output unit.

I wrote code as follows, but sometimes AudioStreamGetPropertyInfo call
with kAudioStreamPropertyPhysicalFormat returns the property is unwritable.
And if it succeed, returned actual sampling rate is unreliable one.
But builtin audio always works normaly.

void
graphSetPStream (const AudioStreamBasicDescription *streamBD)
{
AudioStreamID sid = getStreamIDByAudioDeviceID (currentAudioDeviceID);
AudioStreamBasicDescription ret;
UInt32 outSize;
Boolean outWritable;
OSStatus err;

printf ("current stream id is %d\n", sid);
fflush (stdout);

/* check if output stream is writable */
err = AudioStreamGetPropertyInfo (sid,
0,
kAudioStreamPropertyPhysicalFormat,
&outSize,
&outWritable );

printf ("kAudioStreamPropertyPhysicalFormat writable is %s\n",
outWritable? "true": "false" );
fflush (stdout);

/* set stream physical format */
err = AudioStreamSetProperty (sid,
0,
0,
kAudioStreamPropertyPhysicalFormat,
outSize,
streamBD );

printf ("kAudioStreamPropertyPhysicalFormat result is %d\n", err);
fflush (stdout);

/* get actual description */
err = AudioStreamGetPropertyInfo (sid,
0,
kAudioDevicePropertyStreamFormat,
&outSize,
&outWritable );

err = AudioStreamGetProperty (sid,
0,
kAudioDevicePropertyStreamFormat,
&outSize,
&ret);

}


Best regards,

--Jinnai
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Transport start/stop for Effect Units needed
  • Next by Date: AudioUnit GUI from Cocoa Application
  • Previous by thread: Re: Get events from MyReadProc: results
  • Next by thread: AudioUnit GUI from Cocoa Application
  • Index(es):
    • Date
    • Thread