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

Thread: Audio recording with Teensy 4

  1. #1

    Audio recording with Teensy 4

    I know this is common question but I'm trying to record stereo audio on the Teensy 4 w/Audio board and couldn't find a code that suits the task.

    The Record.ino example that Paul designed works fine for mono. The modified version for recording stereo gives inconsistent results (glitches and jumps).

    I'm wondering which route to take. I've read about adding RAM to the Audioshield. Another alternative seems to solder an external SD card to the T4 back pads to record in 4 bit SPI and make use of the T4 huge RAM, I suppose. Another one is to sell my T4 and get a T3.6 to use with the ready made microSoundRecorder code, which unfortunately is not yet compatible with T4. But I like the smaller size of the T4 for my project. I'm building a recorder for picking up environmental sounds for film production, based on a set of analog preamps and equalisers.

    Another requirement is that the files are written in WAV.

    Any suggestions please???

  2. #2
    Join Date
    Sep 2021
    You need a good SD Card.
    Expensive does not means good!
    Try a Kingston Canvas Go! Plus.
    The Sandisks PJRC recommends is not good anymore.

    Then the user Frank B has an extended waveplayer +recorder on his github account. Both can do many channels. Ask him.

  3. #3
    Thank you for your answer.

    Are you sure that Frank B's waveplayer also records? As far as I can see it only plays (

    With a better SD card I managed to record well, so far so good

    I'm struggling with noise though. I hear some high frequency processing in the background of the waveform which I presume comes from the CPU. The Teensy is battery powered and the sound source is powered with a different set of batteries, so I guess it is no ground loop. Any ideas on how to remove that noise?

    I'm thinking of getting a different audio shield with master clock included but I'm not sure it will solve it.


  4. #4
    BTW. This noise doesn't exist when listening in realtime through the headphone jack of the audio board, so it seems to be introduced during the waveform writing process.

  5. #5
    Join Date
    Sep 2021
    Yes, it records. Not sure why it is not documented. Maybe too new. Just ask him.
    Don't you use the Teensy4 socket?

  6. #6
    I installed the WavePlayer library but cannot find any code that records in the Examples.
    What do you mean with T4 socket? :/ The T4 is soldered to the audioboard.

  7. #7
    Join Date
    Sep 2021
    The SD slot on the Teensy.
    Don't use the one on the shield.

  8. #8

  9. #9
    Thank you for the code!

    When compiling I get an error related to the SD.h library.

    I'm in the Teensy 4.0 here. It doesn't have SD card socket but I've read that it is possible to solder one to the back pads. Do you think that will help out to get rid of the CPU noise too?

    FrankB_rec:74: error: 'FsFile' does not name a type
       FsFile sdFile;
    Multiple libraries were found for "SD.h"
     Used: /Applications/
     Not used: /Applications/
    'FsFile' does not name a type

  10. #10
    Join Date
    Sep 2021
    That means it uses SPI, not the fast SDIO.

    The noise can be a electrical problem. I don't know. Or the card to too slow with the small block sizes microcontrollers use.

  11. #11
    I appreciate your feedback Mcu32. I ordered a T3.6 so I can join the discussions around it. Hopefully things will go better with it and an alternative ADC board.

    Here I leave a recording I made with the noise I'm talking about:

Posting Permissions

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