Audio recording with Teensy 4

Status
Not open for further replies.

domingo

Well-known member
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???
 
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.
 
Thank you for your answer.

Are you sure that Frank B's waveplayer also records? As far as I can see it only plays (https://github.com/FrankBoesing/Teensy-WavePlayer).

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.

Cheers,
Domingo
 
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.
 
Yes, it records. Not sure why it is not documented. Maybe too new. Just ask him.
Don't you use the Teensy4 socket?
 
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.
 
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?

Error:
Code:
FrankB_rec:74: error: 'FsFile' does not name a type
   FsFile sdFile;
   ^
Multiple libraries were found for "SD.h"
 Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
 Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
'FsFile' does not name a type
 
Oh.
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.
 
Status
Not open for further replies.
Back
Top