> My question is : is it really mandatory to use two threads (one for audio in
> an one for audio out).
No.
> What if I do :
>
> while(1)
> {
> read(&buffer); // btw I'll be using alsa not oss
> Process(buffer);
> write(&buffer);
> }
Works fine. Make sure you do
(I quote Benno:)
[blocking read/write] write 4 fragments of silence to the output, at this
point both audio input and audio output will start (or alternatively you
could trigger the start via ioctl() after the write).
The ALSA latency.c test does it a bit different.
> Isn't it ok ? I suppose some people have already written this kind of app...
Yes, I did. I do use 2 threads, 1 for audio in->process->out, and one for
the GUI (FLTK). It's very easy.
Maarten.