Skip to content

Conversation

h4yn0nnym0u5e
Copy link
Contributor

As discussed on forum thread https://forum.pjrc.com/index.php?threads/yet-another-file-player-and-recorder.70963/ Seems to be pretty stable now, so I've added a couple of extra examples and submitted this PR.

Provides 1-, 2-, 4-, 6- and 8- channel playback and recording of WAV files from/to any filesystem, while not interfering with the sketch's ability to access files - all accesses are done via EventResponder so not from within the interrupt handler, which has a tendency to cause all sorts of mayhem.

With reasonably-sized buffers in heap or PSRAM the resilience to other system activities seems pretty good, and playback / recording of multiple files is possible.

Several examples are provided (maybe too many, or too complex?); documentation has been updated.

@madskjeldgaard
Copy link

Extremely exciting!!!

@salkin-mada
Copy link

yay!

@madskjeldgaard
Copy link

I tested this in two different situations today:

  • A teensy 3.2 with the audio shield
  • A teensy 4.0 with an sd card module and the PCM5102A dac board

And both worked wonderfully. Neither of them could reliably play long wav files without intermittent glitches with the normal sd wav file player but with this it works a charm :)

@madskjeldgaard
Copy link

Oh and heads up: The AudioBuffer class clashes with the AudioBuffer in the codecs library.

https://github.com/FrankBoesing/Arduino-Teensy-Codec-lib/blob/master/audiobuffer.h

@h4yn0nnym0u5e
Copy link
Contributor Author

I'll let Paul adjudicate that one. I'm fairly sure he won't be pulling Frank's library, (a) because there's no PR, and (b) because it's GPL, not MIT-licensed.

@h4yn0nnym0u5e
Copy link
Contributor Author

h4yn0nnym0u5e commented Apr 22, 2025

Oh and heads up: The AudioBuffer class clashes with the AudioBuffer in the codecs library.

https://github.com/FrankBoesing/Arduino-Teensy-Codec-lib/blob/master/audiobuffer.h

I've just made a PR on Frank's library, after this issue has been raised on the forum. Since his AudioBuffer is not visible in the API I just renamed it, as that won't be a breaking change (it's not widely used, just for FLAC playback).

@Defragster
Copy link
Contributor

Audio lib SPI conflict on play of BUILTIN_SD and ST7796_t3 screen on Audio Tutorial edits?
https://forum.pjrc.com/index.php?threads/st7796-teensyduino-support.76510/post-357989

Audio is un-hearable. @h4yn0nnym0u5e notes issue relates

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.

4 participants