[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PFile problems



Pierre Phaneuf wrote:

> > >Darn, I remember, threaded sound... It uses a thread to play sound,
> > >that's right? Or just for making itself threadsafe?

Pierre Phaneuf also wrote:
> Well, I guess the former includes the latter, but do you mean it is
> possible to play sound synchronously (without a thread)?

It is possible to play sound synchronously without a thread. Take a look
in AudioToFile.cpp. This file is for the implementation of the
AudioToFile class which is used for systems that I can treat as if the
device was a file. This includes the open sound system (/dev/dsp), the
enlightened sound daemon and simply writing the output to a file. If you
define NO_MIXER_THREAD then instead of having a thread call
AudioToFile::Mix() every now and again, it is assumed that the
programmer is responsible enough to do it regularly enough to prevent
gaps in the sound. I did this so that it would be easier to test since
gdb isn't great with threads.

The software mixing functions can be found in SoftwareMixer.h. If
anybody can optimise them further I would be grateful.

If you don't get a response out of me, just be patient - I'm on holidays
at the moment. There are a few web cams of the town that I am staying in
at http://www.mum.com.au

Peter Burns