[Portaudio] Portaudio general usage question
blomcode at gmail.com
Sat Nov 29 20:34:58 EST 2008
Thanks very much for the reply. This is the road I have begun taking as of
a few days ago.
-thomas blom, austin tx
On Sat, Nov 29, 2008 at 9:53 AM, Richard Ash <richard at audacityteam.org>wrote:
> On Mon, 2008-11-24 at 10:21 -0600, Thomas Blom wrote:
> > I want to write my own record/playback software in which I might play
> > virtual instruments via midi (already doing this with portmidi +
> > portaudio), record the results, record from audio inputs, mix several
> > "tracks" etc -- in general, a simple "daw" like logic/cubase etc for
> > me to experiment with. I've written audio code before, including
> > sound systems for commercial games.
> > In those systems one typically allocates playback buffers from the
> > host audio system and "plays" them via the host api, setting
> > attenuation, panning, etc, with the mixing occuring in non-client
> > code, since most often you're not worried about sample-accurate
> > synchronization between these playback events etc...you mainly worry
> > about managing voices etc...
> > But of course in a daw-type app you want to sync buffers to sample
> > accuracy etc, so it would seem I should allocate only a single
> > portaudio stream, and do all of my own mixing etc... and simply write
> > the 2-channel (or whatever) results to the output stream in the
> > callback.
> That's certainly how Audacity uses portaudio - not least because many
> cheap sound devices won't support more than one open audio stream at
> once without software sound mixing, which isn't always available (and if
> it is, it adds latency).
> > And if the app is to record as well, does this mean I should open the
> > single stream as both read and write?
> Yes - so one callback works with both input and output data.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Portaudio