PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Sound mixer question

angedelamort · 21 Nov 2002, 15:25 UTC
The only way I know, is describe by Kzinti. And with that, if done correctly, you should not heard click between buffer switch. The click only happen when you don't fill the main buffer fast enouph. Maybe by adding a third buffer or increasing the size could help you.
What I did was to create a thread that both fills the buffers and queue them for playing. The thread main loop calls a MIX() function then Sleep(1).

The thread is ABOVE_NORMAL in priority.

The MIX() function checks to see if a buffer is available, then fills and sends it to waveOutWrite().

The problem is that if I use anything besides Sleep(1), skips occur.

Q: Should I only use the thread to fill the buffers and put waveOutWrite() outside of the thread? Or in another thread?

Thanks!