当前位置: 首页 > 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-库的基本操作
  • 我国成年国民综合阅读率82.1%,数字化阅读接触率首超80%
  • 中国工程院院士、歼八Ⅱ飞机系统工程副总设计师温俊峰逝世
  • 金融监管总局:支持将上海打造成具有国际竞争力的再保险中心
  • 乌克兰关切有中国公司帮助俄罗斯制造军事硬件,外交部:坚决反对无端指责
  • 《哪吒2》再次延映至五月底,春节档影片仍有竞争力
  • 高明士︱纪念坚苦卓绝的王寿南先生