Recording Analog Sound to an SD card #293
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I have never used a MAX9814 and you need to double check the properties yourself: It needs to provide an audio output signal osciallating between 0 and 3.3V! To support a file just replace the AudioSink (Serial) with a file. Please note the only additional logic which is needed is the opening of the file in the beginning and the closing when you end the processing. If you want to encode the data e.g. to MP3 or WAV you can find the relevant information here: https://github.com/pschatzmann/arduino-audio-tools/wiki/Encoding-and-Decoding-of-Audio |
Beta Was this translation helpful? Give feedback.
-
Hi, I have a very similar project where I am trying to implement this. I'm not too good with Arduino code and am struggling to work out how to combine the two examples you have given. I can run the first one to display the waveform from my microphone but don't understand how to encode that and write it to my SD card. I got [E] AudioCopy.h : 253 - write to target has failed! from running the encoding example code. This might be because my SD pins are SD_CS 5,SPI_MOSI 23, SPI_MISO 19 and SPI_SCK 18 and am not sure where SD.begin(SdSpiConfig(PIN_CS, DEDICATED_SPI, SD_SCK_MHZ(2))) is getting its values from. |
Beta Was this translation helpful? Give feedback.
-
So, why don't you just use And since - as far as I can see - you use already use the default values you could even leave this away completely... |
Beta Was this translation helpful? Give feedback.
-
To me it is difficult to see where your problem is: A file is a Stream like e.g. Serial, so you would use this as copy destination. Maybe you should learn first how to create and write to files first w/o the audio framework and you need to decide on which of the different libraries you want to use: SD, SDFAT, SDMMC. Here is a example that writes and reads to a File using the SD library: https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-audiokit/streams-audiokit-sd-audiokit/streams-audiokit-sd-audiokit.ino |
Beta Was this translation helpful? Give feedback.
I have never used a MAX9814 and you need to double check the properties yourself: It needs to provide an audio output signal osciallating between 0 and 3.3V!
To get started I suggest that you have a look at this example: https://github.com/pschatzmann/arduino-audio-tools/tree/main/examples/examples-stream/streams-adc-serial where I used a cjmcu-622 Microphone Sensor as input.
To support a file just replace the AudioSink (Serial) with a file. Please note the only additional logic which is needed is the opening of the file in the beginning and the closing when you end the processing.
If you want to encode the data e.g. to MP3 or WAV you can find the relevant information here: https://github…