Skip to content

Access in/out audio data #366

Answered by pschatzmann
franjf97 asked this question in Q&A
Sep 19, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

You are think way too complicated: In this document it is explained how the data format is and that you can handle it like e.g. a file. It also explains the data format: If you don't know how to do this you should probably not be using this framework.

Instead of using copy just do the following:

int16_t buffer[512];
int sample_size = sizeof(int16_t); // if bits_per_sample is set to 16
size_t eff_samples = in.readBytes((uint8_t*)buffer,512*sample_size) / sample_size;
// do with you data whatever you want for eff_samples
..
out.write((uint8_t*)buffer, eff_samples*sample_size);

And of cause there is a callback. Just look it up yourself in the class documentation!

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@franjf97
Comment options

@franjf97
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by pschatzmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants