Hello, I am hoping that someone here has run into this problem before. Here's my situation:
I am working on a project that requires simultaneously playing a wav file from the SD card while recording back to the the same SD card. I haven't found much on this topic from scouring old forum posts.
I have made new program by combining Recorder.ino and WavFilePlayer.ino that can record audio fine on its own and playback wav files fine on their own, but if I try recording AND playing back a wav file simultaneously, only a half-second of the wav file is recorded or it will record the wave file with skips and changes in frequency (like sped up parts). During recording when I trigger the wav file, I will hear the file played back through the headphones normally but this is not how it is being recorded back to the card.
I know that it's possible to use SamplePlayer.ino to playback samples from a wav file that has been converted to a data array. I managed to use this method for recording and playback earlier this will not work for my project.
I want to design an easy to use audio recorder where the user can drag and drop a wav file on to the SD card and easily play it back with the press of a button while recording input from a microphone and the triggered wav file back on to the SD card. I would like to have the user do no manual file conversion (like with wav2sketch) or modification of program code (like including new .cpp and .h files that are needed in the SamplePlayer.ino sketch).
My question is: Is there a simpler or more elegant way that I can achieve this with the Teensy 4.0 and audio shield Rev D? If not, does anyone have ideas for how I could convert wav files on the SD to data arrays automatically on the Teensy, so that they can be played back using the SamplePlayer.ino sketch? That method did not create these corruptions and is my only thought for a workaround but feels a little out of my wheelhouse. My only other thought here is to use a second Teensy + audio shield but I feel like that is overkill.
Is this even within the limits of a single Teensy 4.0? Am I over thinking this problem and using the wrong type of SD card, or not using a correct buffer length, or something? I think this should be possible to do but I am all out of ideas and don't want to waste my time trying to do the impossible with this microcontroller.
Any insights would be greatly appreciated! Thank you!!
I am working on a project that requires simultaneously playing a wav file from the SD card while recording back to the the same SD card. I haven't found much on this topic from scouring old forum posts.
I have made new program by combining Recorder.ino and WavFilePlayer.ino that can record audio fine on its own and playback wav files fine on their own, but if I try recording AND playing back a wav file simultaneously, only a half-second of the wav file is recorded or it will record the wave file with skips and changes in frequency (like sped up parts). During recording when I trigger the wav file, I will hear the file played back through the headphones normally but this is not how it is being recorded back to the card.
I know that it's possible to use SamplePlayer.ino to playback samples from a wav file that has been converted to a data array. I managed to use this method for recording and playback earlier this will not work for my project.
I want to design an easy to use audio recorder where the user can drag and drop a wav file on to the SD card and easily play it back with the press of a button while recording input from a microphone and the triggered wav file back on to the SD card. I would like to have the user do no manual file conversion (like with wav2sketch) or modification of program code (like including new .cpp and .h files that are needed in the SamplePlayer.ino sketch).
My question is: Is there a simpler or more elegant way that I can achieve this with the Teensy 4.0 and audio shield Rev D? If not, does anyone have ideas for how I could convert wav files on the SD to data arrays automatically on the Teensy, so that they can be played back using the SamplePlayer.ino sketch? That method did not create these corruptions and is my only thought for a workaround but feels a little out of my wheelhouse. My only other thought here is to use a second Teensy + audio shield but I feel like that is overkill.
Is this even within the limits of a single Teensy 4.0? Am I over thinking this problem and using the wrong type of SD card, or not using a correct buffer length, or something? I think this should be possible to do but I am all out of ideas and don't want to waste my time trying to do the impossible with this microcontroller.
Any insights would be greatly appreciated! Thank you!!