Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Audio Streaming from Memory

  1. #1

    Audio Streaming from Memory

    Hello, I'm new here. I've been messing around with some audio stuff on some boards like ESP32 and made a Pokemon music player, as well as a Nintendo DS music player. I wanted to port these over to Teensy 3.6, although I've been having some issues with the audio library. It's a bit different from what I'm used to, but I noticed that there was code to play audio from memory. Unfortunately, I could not find an example on this. My projects basically just wrote the audio to a buffer until it was full, and would be notified to fill it when more space was available, while the device would stream it. Is there an example that could do this on the teensy? I was thinking of using the DAC for a built in speaker, but using a separate processor board for the headphone output.

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,383
    there are examples, in the IDE select File > Examples > Audio > SamplePlayer
    You should watch the audio tutorial https://www.pjrc.com/teensy/td_libs_Audio.html
    and read the audio workshop manual https://github.com/PaulStoffregen/Au...r/workshop.pdf

    With the T3.6 you have the option of playing WAV files from the onboard microSD File > Examples > Audio > WavFilePlayer


    https://www.pjrc.com/teensy/gui

    The Teensy DAC can only source 1 ma, so its output should be fed into an amp fronting headphone/speakers.
    Last edited by manitou; 10-16-2018 at 11:35 AM.

  3. #3
    Quote Originally Posted by manitou View Post
    there are examples, in the IDE select File > Examples > Audio > SamplePlayer
    You should watch the audio tutorial https://www.pjrc.com/teensy/td_libs_Audio.html
    and read the audio workshop manual https://github.com/PaulStoffregen/Au...r/workshop.pdf

    With the T3.6 you have the option of playing WAV files from the onboard microSD File > Examples > Audio > WavFilePlayer


    https://www.pjrc.com/teensy/gui

    The Teensy DAC can only source 1 ma, so its output should be fed into an amp fronting headphone/speakers.
    i just seen the sample player example last night while digging around. it seems to be the closest to what i need, although I'm not sure if it can be a refillable buffer. Playing wav files probably wont work, since both projects "emulate" the sound system, and generate the sequenced music to an audio stream (closest example is like a midi + soundfont being streamed). They could be converted to Wav, although i got the emulation coded, so a whole soundtrack could be as small as a few MB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •