On Thu, Feb 25, 2016 at 3:44 PM, STEFFAN DIEDRICHSEN <sdiedrich...@me.com>
wrote:

>
> On 25.02.2016|KW8, at 03:43, Ross Bencina <rossb-li...@audiomulch.com>
> wrote:
>
> I'm surprised it's apparently so uncommon to implement a
> callback interface for providing samples when resampling. It's the
> really the natural thing to do.
>
>
>
> In a C-environment, it’s OK, it’s fast, no overhead, etc. However, in C++
> in can be a bit clumsy, the syntax is a bit complex, but doable. An
> alternative in C++ is an abstract base class for the data source, an
> concrete instance is passed to the SRC. See below.
>
>
Steffan
>
>
> class CSRC_DataSource
> {
> public:
>
>
> virtual  ~CSRC_DataSource(){}
>
>
>   virtual size_t FillBuffer (float* pfBuffer, size_t iMaxFrames){return 0;}
> // return the number of frames being written.
>


Well, this is also a callback. And as I wrote, I needed a C interface, so a
virtual method
was not an alternative.

By the way, the tone of this mailing list is quite condescending. I don't
think I'm going ask this type
of question again on this mailing list. When you ask if there is an
implementation
of something available, you don't expect people to teach you programming
lessons and sprout about
how useful it would be for your personal development to implement things
yourself. Not
that there is anything wrong with programming lessons, but the context was
wrong.

Anyway, thanks to everyone who gave links to resampler implementations, and
to Evan who
posted his code. I really appreciated it.
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to