The docs here are relatively vague about creating your own audio objects:
https://www.pjrc.com/teensy/td_libs_AudioNewObjects.html
First off, this document doesn't indicate any return values for the methods it highlights, is there a better set of annotated methods?
I did find the source in the github repo, https://github.com/PaulStoffregen/cores/blob/master/teensy3/AudioStream.h but there is very little commenting. I find that this is the case for most of the libraries, it is hard to find documentation, is there a definitive location for this that I'm missing? I'd recommend at least adding a link to the header file in the document about creating your own objects.
Second:
For input you have to provide the number of channels and an "array of audio block pointers used for the inputs" in the constructor.. but then later the doc indicates 2 functions "receiveReadOnly(channel);" and "receiveWritable(channel);"
"Receive a block of incoming audio from an input channel..."
So this is in addition to passing my array of input buffers to the AudioStream constructor? Does one normally just assign back into the array that you passed to the constructor? I assume I need to call release on any block I get from these receive methods even if I'm storing their return value in an instance variable [iqueue]?
Third:
I see that allocate [and the receive methods above] can return null. Besides memory concerns, is there any reason not to just have audio_buffer_t objects [not pointers] in my class and avoid allocate/release?
Finally:
I'm using floating point for my audio computation. Do you [Paul] have any code [teensy 3.6] to efficiently convert between an array of floats from -1..1 and to an array of int16_t [INT16_MIN..INT16_MAX] ideally with the ability to deal with interleaving/de-interleaving?
Thanks,
Alex
https://www.pjrc.com/teensy/td_libs_AudioNewObjects.html
First off, this document doesn't indicate any return values for the methods it highlights, is there a better set of annotated methods?
I did find the source in the github repo, https://github.com/PaulStoffregen/cores/blob/master/teensy3/AudioStream.h but there is very little commenting. I find that this is the case for most of the libraries, it is hard to find documentation, is there a definitive location for this that I'm missing? I'd recommend at least adding a link to the header file in the document about creating your own objects.
Second:
For input you have to provide the number of channels and an "array of audio block pointers used for the inputs" in the constructor.. but then later the doc indicates 2 functions "receiveReadOnly(channel);" and "receiveWritable(channel);"
"Receive a block of incoming audio from an input channel..."
So this is in addition to passing my array of input buffers to the AudioStream constructor? Does one normally just assign back into the array that you passed to the constructor? I assume I need to call release on any block I get from these receive methods even if I'm storing their return value in an instance variable [iqueue]?
Third:
I see that allocate [and the receive methods above] can return null. Besides memory concerns, is there any reason not to just have audio_buffer_t objects [not pointers] in my class and avoid allocate/release?
Finally:
I'm using floating point for my audio computation. Do you [Paul] have any code [teensy 3.6] to efficiently convert between an array of floats from -1..1 and to an array of int16_t [INT16_MIN..INT16_MAX] ideally with the ability to deal with interleaving/de-interleaving?
Thanks,
Alex