[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Audio Questions
From: |
Michael Dickens |
Subject: |
[Discuss-gnuradio] Audio Questions |
Date: |
Sat, 26 Nov 2005 16:50:24 -0500 |
I'm working on gr-audio-osx (MacOS X 10.4 using "CoreAudio" or a
related framework), and have some questions. I did a quick search of
the email archive, but didn't come upon anything useful for this
question in the first few pages of results (lots of other interesting
stuff though). Should be pretty straight forward to create a basic
source and sink, though I do have a few (should be) simple questions.
Looking at gr-audio-oss and gr-audio-alsa, it looks like I primarily
have to define src/audio_osx_sink.[cc,h] and src/audio_osx_source.
[cc,h]; the other files will follow from the changes made to these
files.
Taking "sink" as an example, it looks like what I need to do is modify
1) "audio_osx_sink::audio_osx_sink" to open and start the audio
channels, allocate any buffers, setup audio parameters
2) "audio_osx_sink::~audio_osx_sink" to close the channels, delete
buffers, etc...
3) "audio_osx_sink::work" to "play" the incoming data to the output
audio channels
Questions about "audio_osx_sink::work":
int audio_osx_sink::work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
a) It looks like the audio input (input_items) is in float's; is this
true?
b) On CoreAudio, I can open channels to use float's as inputs, and
thus could use the audio input ( (input_items) directly for audio
playback. I believe that CoreAudio doesn't copy the input buffer,
but rather uses it as is; this can be done either a/synchronously.
But: Do I need to copy the input data to a temporary buffer before
playing, or will the input buffer (input_items) have a long enough
life to allow for its playing? Can any other subroutine use this
buffer simultaneously, or do all subroutines need to make a copy of
it before doing their processing?
c) When does ::work get called? Is it on a regular period, no matter
how much data has come in since the last time it was called? Or when
enough data is available to fill a given buffer size?
- [Discuss-gnuradio] Audio Questions,
Michael Dickens <=