Help - Search - Members - Calendar
Full Version: Some DSP questions
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
Chungalin
Hello,

I'm developing a DSP plugin and at this point I have some doubts:

1) How should I deal with audio chunks with a sample count of zero? Discard them or just pass them through?

2) How can I neatly discard an audio chunk? Maybe setting the sample count to zero?

3) What really happens if I return false in on_chunk?

4) Is the main architecture of foobar explained anywhere? Is it push or pull flow-control based? From the DSP point of view looks like push, but...

Thanks
foosion
QUOTE(Chungalin @ Nov 26 2005, 03:01 PM)
1) How should I deal with audio chunks with a sample count of zero? Discard them or just pass them through?
*
If you don't discard them, the playback engine will.

QUOTE(Chungalin @ Nov 26 2005, 03:01 PM)
2) How can I neatly discard an audio chunk? Maybe setting the sample count to zero?

3) What really happens if I return false in on_chunk?
*
If on_chunk() returns false, the chunk will be removed from the chunk list passed to you by the playback engine, so unless you store the data in a private buffer, the chunk is effectively discarded.

QUOTE(Chungalin @ Nov 26 2005, 03:01 PM)
4) Is the main architecture of foobar explained anywhere? Is it push or pull flow-control based? From the DSP point of view looks like push, but...
*
Decoders, DSPs and outputs are all driven by the playback engine and process or produce data on its request.
Chungalin
Thanks for your reply, foosion smile.gif . I needed to be sure, since I'm working on a DSP that its input:output ratio is not 1:1. You're right, part of the data will be held in a private buffer.

Regarding the null sized chunks, actually it was my fault. I thought I was receiving them, but I was generating them instead sad.gif . An ugly console error is raised each time a null chunk is detected so it cannot pass unnoticed!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.