Skip to content

Conversation

h4yn0nnym0u5e
Copy link
Contributor

Some dialogue on the Teensy forum raised the issue of support for 24- or 32-bit output; for example see
https://forum.pjrc.com/index.php?threads/updated-8x8-and-16x16-audio.75569/post-357275 Obviously not supported by the 16-bit Audio library, but partially supported in this library for I²S and S/PDIF.

Since the existing TDM support usually emits 32-bit samples, forcing use of even-numbered ports only, there is an opportunity to adopt the I/O objects directly by converting two 16-bit TDM port values (containing high and low words) to and from a single F32 stream, giving 24-bit I/O.

This commit implements the required conversion objects, plus a minor change to AudioStream_F32 needed for the
AudioConvert_I16x2toF32 class.

Some dialogue on the Teensy forum raised the issue of
support for 24- or 32-bit output; for example see
https://forum.pjrc.com/index.php?threads/updated-8x8-and-16x16-audio.75569/post-357275
Obviously not supported by the 16-bit Audio library,
but partially supported in this library for I²S and S/PDIF.

Since the TDM support usually emits 32-bit samples, forcing use
of even-numbered ports only, there is an opportunity
to adopt the I/O objects directly by converting two
16-bit TDM port values (containing high and low words) to
and from a single F32 stream, giving 24-bit I/O.

This commit implements the required objects, plus a
minor change to AudioStream_F32 needed for the
AudioConvert_I16x2toF32 class.
@h4yn0nnym0u5e
Copy link
Contributor Author

I don't currently have a decent example sketch for this, but if encouraged I could do one. I've tested to the best of my ability, but frankly can't easily tell by ear whether I have 16- or 24-bit I/O!

@h4yn0nnym0u5e h4yn0nnym0u5e mentioned this pull request Apr 16, 2025
@boblark
Copy link
Collaborator

boblark commented Apr 18, 2025

Thanks Jonathan for working this up. Neither of the changes should affect existing 16-bit audio. I will merge this in and also update the F32 Audio Design Tool. There is also a do-nothing change for the gain file, that I may be able to remove, but it is a harmless white space change, anyway. If you have an example for TDM handy, that would be good! Bob

@boblark boblark merged commit 4a0477a into chipaudette:master Apr 18, 2025
@boblark
Copy link
Collaborator

boblark commented Apr 18, 2025

I updated the F32 design tool to include the two I16x2 classes. Comments are welcomed. Bob
__

@boblark
Copy link
Collaborator

boblark commented Apr 18, 2025

That is F32 Design Tool They are on the left under "Convert".

@h4yn0nnym0u5e
Copy link
Contributor Author

Great, thanks Bob. I'll try to put together a simple TDM demo in the next few days.

Apologies for the non-change to the gain file, I must have touched it accidentally while sorting out a decent way to get two I16 inputs into the converter, and not noticed when I committed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants