当前位置: 首页 > news >正文

ESP32-S3开发板麦克风录音到SD卡存储测试

硬件版本:ESP32-S3-EYE-MB_V2.2

软件版本:esp-idf-v5.4.1

实测ESP的DEMO,无法正常运行。

测试修改验证:实现麦克风录音到SD卡存储。

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <sys/unistd.h>

#include <sys/stat.h>

#include "esp_log.h"

#include "esp_err.h"

#include "esp_system.h"

#include "esp_vfs_fat.h"

#include "freertos/FreeRTOS.h"

#include "freertos/task.h"

#include "driver/i2s.h"

#include "driver/gpio.h"

#include "driver/spi_common.h"

#include "sdmmc_cmd.h"

#include "sdkconfig.h"

#include "driver/sdmmc_host.h"

#include "driver/i2s_pdm.h"

static const char* TAG = "pdm_rec_example";

#define SPI_DMA_CHAN        SPI_DMA_CH_AUTO

#define NUM_CHANNELS        (1) // For mono recording only!

#define SD_MOUNT_POINT      "/sdcard"

#define SAMPLE_SIZE         (CONFIG_EXAMPLE_BIT_SAMPLE * 1024)

#define BYTE_RATE           (CONFIG_EXAMPLE_SAMPLE_RATE * (CONFIG_EXAMPLE_BIT_SAMPLE / 8)) * NUM_CHANNELS

// When testing SD and SPI modes, keep in mind that once the card has been

// initialized in SPI mode, it can not be reinitialized in SD mode without

// toggling power to the card.

//sdmmc_host_t host = SDSPI_HOST_DEFAULT();

sdmmc_card_t* card;

i2s_chan_handle_t rx_handle = NULL;

static int16_t i2s_readraw_buff[SAMPLE_SIZE];

size_t bytes_read;

const int WAVE_HEADER_SIZE = 44;

#define BSP_SD_CLK          (39)

#define BSP_SD_CMD          (38)

#define BSP_SD_D0           (40)

// I2S配置

// Configure PDM microphone pins

#def

相关文章:

  • 自主可控鸿道Intewell工业实时操作系统
  • Rust 语言使用场景分析
  • 【LangChain4j】AI 第一弹:LangChain4j 的理解
  • 图聚类中的亲和力传播
  • 数据库11(触发器)
  • 跨平台软件开发探讨
  • 三目云台转动性能稳定性
  • 动态显微镜数据分析及AI拓展
  • 第50讲:AI+农业金融与风险预测场景实战
  • Centos9安装docker
  • spark和hadoop之间的对比关系和联系
  • 《MySQL:MySQL表的内外连接》
  • 线程入门3
  • es 自动补全
  • Available platform plugins are: xcb.报错解决办法
  • 2026《数据结构》考研复习笔记六(串的KMP算法)
  • 4.多表查询
  • Vue3集成百度实时语音识别
  • 工业相机中CCM使能参数-色彩校正矩阵
  • MYSQL-库的基本操作
  • 擦亮“世界美食之都”金字招牌,淮安的努力不止于餐桌
  • 80后共青团云南省委副书记许思思已任迪庆州委副书记
  • 直播电商行业代表呼吁:携手并肩伸出援手助力外贸企业攻坚克难
  • 葡萄牙总理:未来几小时内将全面恢复供电
  • 习近平:在庆祝中华全国总工会成立100周年暨全国劳动模范和先进工作者表彰大会上的讲话
  • 监狱法修订草案提请全国人大常委会会议审议