A fun little project to test out the mic on the M5Stack CORE2

Overview

M5Stack Core 2 Audio

You can watch a video explainer here (YouTube) which goes into a bit more detail on the audio capabilities of the device.

Demo Video

This project is a nice little demo of audio on the M5Stack Core 2 with some simple visualisations.

You'll need to use PlatformIO to build the project.

To clone the repo use:

git clone --recursive [email protected]:atomic14/m5stack-core2-audio-monitor.git

This will make sure you get the M5Core2 library as well.

Hopefully, the code should be easy to understand.

If you want to add some more visualisations then please open up a pull request and contribute some code.

And if you'd like to buy me a coffee...

ko-fi

You might also like...
A little VST to test playhead reading

TempoTester This is a little AU/VST3 which just puts al the playhead information on the screen, useful for debugging DAWs. Standard instructions clone

An area to test reading in ATLAS xAOD format and writing out to Parquet

xaod_to_parquet An area to test reading in ATLAS xAOD format and writing out to Parquet Getting the Code Clone the repository with the --recursive fla

TestFrame - This is a test framework that uses Raylib and ImGui together to help test and develop concepts
TestFrame - This is a test framework that uses Raylib and ImGui together to help test and develop concepts

This is a test framework that uses Raylib and ImGui together to help test and develop concepts. It is made using C++ because it uses classes for windows and views.

MasterPlan is a project management software / visual idea board software. It attempts to be easy to use, lightweight, and fun.
MasterPlan is a project management software / visual idea board software. It attempts to be easy to use, lightweight, and fun.

MasterPlan is a customizeable graphical project management software for independent users or small teams. If you need to share plans across a whole co

A fun Snowfall/Rainfall Project with Interactions

snowfall Snowfall Project Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is yo

ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project)
ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project)

esp32_esp8266_organ ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project) link to the video The required li

ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project)
ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project)

ml_synth_organ_example MIDI Organ using the ML_SynthTools library (little example arduino project) link to the video This project is an example suppor

Little project on ATtiny13 (AVR microcontroller)
Little project on ATtiny13 (AVR microcontroller)

Night-light Hello everyone.This is not a big project,created specifically for the "AVR ATtiny13" microcontroller. It embodies the concept of a night l

A colorful FFT programm demonstrating acoustic data decomposition. For profit and fun.
A colorful FFT programm demonstrating acoustic data decomposition. For profit and fun.

FFT power spectrum visualizer A high-quality demonstration of the application can be found at https://www.youtube.com/watch?v=AaJ25F8pjOw https://www.

Welcome to my dungeon. Here, I keep all my configuration files in case I have a stroke and lose all my memory. You're very welcome to explore and use anything in this repository. Have fun!

Fr1nge's Dotfiles Welcome to my dungeon. Here, I keep all my configuration files in case I have a stroke an d lose all my memory. You're very welcome

This repo is just for fun while playing with some OOP constructions in C

c-oop This repo is just for fun while playing with some OOP constructions in C. As it is not intended to be of any OOP reference of implementation it

funky fun fuzzer

FunkyFunFuzzer / fffz FunkyFunFuzzer / fffz is an attempt at a file fuzzer prioritising usability while striving for real-world performance. It is a m

A mini assembler for x86_64, written for fun and learning.

minias A mini assembler for x86_64, written for fun and learning. Goals: A simple, tiny, fast implementation (in that order). Assemble the output of c

A basic example of IoT for fun
A basic example of IoT for fun

esp32 simple led IoT A basic example of IoT for fun about Im using platformio for upload this project so u should be used that if you want to use this

A mini x86-64 assembler for fun

A mini x86-64 assembler for fun

A fast and fun layout manager for FLTK
A fast and fun layout manager for FLTK

Fl_Flow A fast and fun layout manager for FLTK Fl_Flow is a layout manager for FLTK which works in a largely different manner to existing systems you

Having some fun with the C++ programming language.
Having some fun with the C++ programming language.

Having some fun with the C++ programming language. Coding Environment Text editor. Visual Studio Code for Windows Compiler. MingW GCC 6.3.0 Coding sty

Just a password tool that I make for fun and the sake of my fascination

Note I made this in 1 day and I only have 1 years of experience, feel free to critique my spaghetti of a code. And if 15 chars of password isn't enoug

An embeddable programming language just for fun

hm3 A vapourware minimalist statically typed 'glue language' that can be embedded in C/C++/Rust projects. The implementation aims to capture the essen

Comments
  • Improvements

    Improvements

    Signal quality could be significally improved with the following minimal code modification:

    1. In main.cpp
      .sample_rate = 64000, // this expands frequency range to 8 kHz
    2. In I2SSampler.cpp //// int16_t i2sData[1024]; int16_t i2sData[2048];
      // read from i2s //// i2s_read(sampler->m_i2sPort, i2sData, 2048, &bytesRead, 10); i2s_read(sampler->m_i2sPort, i2sData, 4096, &bytesRead, 10);
      //// for (int i = 0; i < bytesRead / 2; i++) for (int i = 0; i < bytesRead / 2; i+=2)

    Photos show aquired signal before and after modification. before

    after

    opened by Kabron287 3
  • I hope this is ok?

    I hope this is ok?

    Hiyah!

    I've changed the project to build via the Arduino IDE, as an alternative to the PlatformIO it originally uses.

    As you can see in the readme... I've made it clear the excellent code's not mine!

    I hope this is ok? xx

    opened by Sarah-C 2
  • cant clone repository

    cant clone repository

    I get the following error when using : git clone --recursive [email protected]:atomic14/m5stack-core2-audio-monitor.git

    image

    and the following issue when cloning repo using Visual Studio Code: https://github.com/atomic14/m5stack-core2-audio-monitor.git

    image

    opened by magnetus26 0
  • Need Help: Two different M5 Core 2 device giving different output.

    Need Help: Two different M5 Core 2 device giving different output.

    I have set a sample code to record audio signal. One device is with my partner in USA and other is with me in India. Both device are M5 Core 2. We both get different Zero line for output. Our code is 100% same as same firmware is built and flash by me.

    My Partner's output image My output image

    My I2S setting to record audio

    esp_err_t err;
    const i2s_port_t I2S_PORT = I2S_NUM_0;
    // i2s config for reading from both m5stack mic
    i2s_config_t i2s_config = {
        .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM),
        .sample_rate = 16000,
        .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
        .channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT,
        .communication_format = I2S_COMM_FORMAT_I2S,
        .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
        .dma_buf_count = 4,
        .dma_buf_len = dmaBufCount,
    };
    
    // i2s pins
    i2s_pin_config_t i2s_pins = {
        .bck_io_num = GPIO_NUM_12,
        .ws_io_num = GPIO_NUM_0,
        .data_out_num = I2S_PIN_NO_CHANGE,
        .data_in_num = GPIO_NUM_34};
    
    

    This is in Loop of 2 milliseconds to record audio. (Sample rate 500Hz)

      esp_err_t result = i2s_read(I2S_PORT, i2sData, 16, &bytesRead, 10);
      if (result == ESP_OK && bytesRead >= 16)
      {
        for (int i = 0; i < bytesRead / 2; i += 2)
        {
          soundAvg += (i2sData[i] + i2sData[i + 1]) / 2;
        }
        soundAvg = soundAvg / 8;
        AvgSound = soundAvg;
      }
    

    If my settings are incorrect. Can you please let me know what should be the optimum setting to record at 500Hz, we are capturing industrial noise along with vibrations being recorded in same loop from MPU6886.

    opened by bhupiister 0
Owner
atomic14
atomic14
Audio out with an FTDI UART cable

Audio out with an FTDI UART cable This encodes audio as either PDM (using a first order sigma-delta stage), 32-bits PWM or 64-bits PWM and sends it as

Konrad Beckmann 42 Jun 23, 2022
PendulumSynth is an on-going and open-source project, running on Arduino platform with the goal of mixing real-world physics into music composition and musical performance.

PendulumSynth PendulumSynth is an on-going and open-source project, running on Arduino platform with the goal of mixing real-world physics into music

Mohammadreza Anvari 3 Oct 7, 2022
Just a fun little project to learn how to render Bézier Curves.

Bézier Curve Just a fun little project to learn how to render Bézier Curves. CPU implementation GPU implementation Screencasts Thumbnail Link Coding B

Tsoding 18 Dec 17, 2022
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

null 6.6k Jan 8, 2023
This is a prank windows malware, is only for fun, it's just for fun, it's not harmful

DBUSTER-PRO (C) 2021-2022 DioBrando This is a prank windows malware, just for fun, nothing harmful. I will teach you how to compile, and remove malwar

Dio brando 8 Apr 15, 2022
Port of my M5Stack Core 2 audio monitor project to generic ESP32s with TFT screens

ESP32 Audio Monitor This is a port of this project to work with any ESP32 device with a TFT display. You can watch a video explainer here (YouTube) wh

atomic14 47 Nov 9, 2022
This is a software renderer for Dear ImGui. I built it not out of a specific need, but because it was fun

Dear ImGui software renderer This is a software renderer for Dear ImGui. I built it not out of a specific need, but because it was fun. The goal was t

Emil Ernerfeldt 214 Dec 22, 2022
Publish UnitV recognition result as ROS topic via M5Stack

Publish UnitV recognition result as ROS topic via M5Stack

Naoya Yamaguchi 2 Sep 11, 2021
A vMix tally light for the M5Stack Core 2.

M5Stack Core2 vMix Tally Indicator A tally light indicator for vMix which runs on the M5Stack Core2. Requirements Arduino IDE M5Stack Core2 Dependenci

null 2 Oct 16, 2022
Poc to test my little friend features without any sdk

poc.vic-hack POC to test my little friend "vector" features without any sdk Ultimate goal - being able to write own firmware components without propri

Oleg Lytvynenko 8 Feb 26, 2022