Re: Play from Audio CD
Re: Play from Audio CD
- Subject: Re: Play from Audio CD
- From: Brian Willoughby <email@hidden>
- Date: Thu, 10 Jun 2010 13:23:50 -0700
On Jun 10, 2010, at 08:09, John Johnson wrote:
Hey everyone. I'm trying to play audio directly from a CD. I have
an audio ripper that's set up to rip the audio; it rips a certain
number of sectors and then passes it back to a delegate object to
process in the form of an AudioBufferList. Here is where I write
the audio data to a file. My question is how would I begin playing
that file before the ripping is completely done? It seems the audio
file is not playable until I call AudioFileDispose...
I could not find AudioFileDispose in the headers. Perhaps there is
an example in the CoreAudio archives of how to flush a file to disk
while it is being written.
Maybe it's possible to play the audio data directly without the
need for an intermediate file, I don't know.
It's certainly possible to play the data directly, while writing it
to a file in parallel. However, you would need a multi-threaded
design so that the audio does not glitch while you're ripping or
writing. The ripping thread should basically write to a memory
queue, while a playback thread plays from that queue without access
any files or the disk. While you're at it, you might as well
separate the file writing code into another thread unless it works
out easily to keep it in the ripping thread.
Brian Willoughby
Sound Consulting
_______________________________________________
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