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

Thread: Simplest Audio Out to speaker on Teensy 4

  1. #1
    Junior Member
    Join Date
    Feb 2016
    Posts
    3

    Simplest Audio Out to speaker on Teensy 4

    I've been using the Teensy 3.2 in my experimental arcade game Line Wobbler (mostly just using the wave generator in various ways) and simply using a capacitor and the DAC pin to a small amplifier board, as recommended here.

    I've been looking how to do this on a Teensy 4, and since there's no DAC on it, I've been looking for alternatives. So far, the simplest seems to be using two PWM pins, but that's seems to be more parts and less resolution. Are there other work-arounds? I'm also happy to spend 1-2 USD on a little board. Perhaps an I2S amplifier board? FWIW, I'm driving a 3W (mono) speaker.

  2. #2
    Junior Member
    Join Date
    Aug 2019
    Posts
    16
    Quote Originally Posted by Robin_B View Post
    I've been using the Teensy 3.2 in my experimental arcade game Line Wobbler (mostly just using the wave generator in various ways) and simply using a capacitor and the DAC pin to a small amplifier board, as recommended here.

    I've been looking how to do this on a Teensy 4, and since there's no DAC on it, I've been looking for alternatives. So far, the simplest seems to be using two PWM pins, but that's seems to be more parts and less resolution. Are there other work-arounds? I'm also happy to spend 1-2 USD on a little board. Perhaps an I2S amplifier board? FWIW, I'm driving a 3W (mono) speaker.
    I really wouldn't bother with the MQSL/R pins. A new definition of 'Medium Quality Audio' from NXP I'm afraid. Cheapest solution is probably to buy one of those $1 USB audio dongles and then rip off the USB - there's several article and Youtubes on doing this. Or you may even be able to make the Teensy talk to it through a USB hub but not sure of that.

  3. #3
    Junior Member
    Join Date
    Aug 2019
    Posts
    1
    For a video game, a single PWM output might give you a quality and flavor of sound that's desirable. If it doesn't sound great at first, try editing your audio in something like audacity to remove low and high frequencies, that would otherwise cause rumble, distortion, or aliasing. Then see if that works for you?

  4. #4

  5. #5
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    pin7 works with the example sketches. sounds horrible, but works.

  6. #6
    Junior Member
    Join Date
    Feb 2016
    Posts
    3
    Quote Originally Posted by reaganr View Post
    pin7 works with the example sketches. sounds horrible, but works.
    As single-pin PWM, you mean?

Posting Permissions

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