1 Star 1 Fork 1

qsnail123 / esp32_sdcard_audio

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

ESP32 SDCard Wave File Example

This code shows how to record a WAV file to an SD Card attached to an ESP32 and then play it back.

There's an explanatory video here

Demo Video

There are two projects - one using Arduino and one using the Esspresif IDF. Both of these projects use PlatformIO to build.

Edit config.h for your device. In particular, you will probably want to change the button that is used to trigger recording and playback.

// record button
#define GPIO_BUTTON GPIO_NUM_23

Do I need Pull-Up resistors

A few people have reported that they have only been able to get this to work by adding pull up resistors.

This is recommended by Espressif under some circumstances

So if you are having issues with your SD Card not initialising then I'd suggest trying to add 10K pull resistors to the lines to see if that fixes your issues.

Wiring

Wiring up should be reasonably straightforward. The pins on an SD Card are as follows:

SD Card Pins

Make sure you update the config.h file with the GPIO pins you have used for your SD Card. Double-check that you have NOT re-used one of the pins that has been setup for the speaker or microphone.

Usage

To record audio press and hold the button. Recording will stop when you release the button.

The SD Card should contain a file called test.wav after a successful recording.

To playback the recording push the button.

Once the playback has finished the device will switch back to waiting for a new recording to be made.

Arduino

The arduino-wav-sdcard folder has code that works on the current release of Arduino for the ESP32.

IDF

The idf-wav-sdcard folder has code that works with the latest IDF release.

MIT License Copyright (c) 2021 atomic14 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

A simple example that shows how to record a WAV file to an SD Card on the ESP32 展开 收起
C++ 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qsnail123/esp32_sdcard_audio.git
git@gitee.com:qsnail123/esp32_sdcard_audio.git
qsnail123
esp32_sdcard_audio
esp32_sdcard_audio
main

搜索帮助