Re: Playing sound
Re: Playing sound
- Subject: Re: Playing sound
- From: Jeff Moore <email@hidden>
- Date: Tue, 05 Jun 2001 12:24:19 -0700
on 6/5/01 9:09 AM, Ken Wieschhoff <email@hidden> wrote:
>
I have a unique problem I'm attempting to find a solution to.
>
>
My USB Modem contains a USB Pipe whose sole purpose is to provide
>
linear PCM samples of sound data for playback through the default
>
output device. I need a way to play those samples.
I'll let someone more knowledgeable about the driver side of things answer
those questions in more detail. I'll try to speak to the other issues you
raise.
>
On the USB mailing list Roger Smith has suggested I can create an
>
IOAudioDevice from the USB driver. Would this be as simple as
>
creating the IOAudioDevice and calling it's start method to allow it
>
to be found by an application? Once the IOAudioDevice is
>
instantiated, can I simply populate and timestamp an IOAudioDMAEngine
>
structure to make the samples playable?
In theory it should be.
>
To check if I'm on the correct path, will there be entries in
>
IORegistryExplorer where I can see what the system is up to?
Yes.
>
Does the Daisy sample code contain examples of how my player
>
application would find my new device?
Yes.
The algorithm goes something like this:
1) Call AudioHardwareGetPropertyInfo with kAudioHardwarePropertyDevices to
get the size of the device list in bytes.
2) Allocate enough memory to hold the list.
3) Call AudioHardwareGetProperty with kAudioHardwarePropertyDevices and a
pointer to the memory to hold the list and the HAL will fill it out with the
AudioDeviceIDs of all the currently known devices.
>
Initially it appears I really wouldn't want my device to show up as a
>
sound source, is there a way my application can search specifically
>
for my device while allowing other applications to ignore this device?
Unfortunately not at the moment. I'll write this up as a feature request.
>
Also is Dave Hill present on this list? I opened a DTS incident last
>
week and he had promised to follow up with some sample code I'll
>
eventually need for the playback application.
Daisy provides a good example of how to get and send data from/to a device.
--
Jeff Moore
Core Audio
Apple