[flac-dev] Newbie question about those callbacks

Johnny Rosenberg gurus.knugum at gmail.com
Sat Feb 9 14:04:27 PST 2013


For instance the write_callback thing:
client_data – can it be a pointer to just about anything? For instance
a pointer to a two-dimensional array?

Are those FLAC-WAV and WAV-FLAC examples the only examples available?

What would be the best approach to read a FLAC file to an array of
some kind? Passing a pointer to the array as ”client_data”? I'd like
to use a two-dimensional array, but it's a little tricky (for a
newbie) to pass to functions as a pointer.

It seems like the audio data is passed to the write_callback in a
small buffer. A very small buffer, in fact, only a little more than
4000 frames in my case. Is that to keep the memory usage low?

I can't work directly with the buffer anyway, since I need to
manipulate things ”between the buffers”. That is, if I find something
in the beginning or end of the buffer, I need to manipulate data that
is no longer available in the buffer. That's why I need to read the
whole file into an array.

Maybe I should just do something else, I'm probably too stupid for
these things anyway. Or too old. Or both.


Thanks for listening, you don't need to reply to this crap, sorry.



Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ


More information about the flac-dev mailing list