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

Issues
  • 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 4 Jun 19, 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 17 Apr 29, 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.3k Jun 27, 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 41 Jun 23, 2022
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
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 198 Jun 17, 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 1 Apr 12, 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
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

Paul 1 Dec 21, 2021
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

Daniel Antrim 2 Nov 19, 2021
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.

Jeffery Myers 21 May 13, 2022
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

Marcel 11 Jun 6, 2022
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

Marcel 11 Jun 6, 2022
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

null 1 Jan 7, 2022
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

SolarLune 405 Jun 23, 2022
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

Paras Jain 7 Jan 21, 2022
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Cacahuète Sans Sel 18 Apr 27, 2022
QuickCheck clone for C++ with the goal of being simple to use with as little boilerplate as possible.

RapidCheck RapidCheck is a C++ framework for property based testing inspired by QuickCheck and other similar frameworks. In property based testing, yo

null 826 Jun 16, 2022
Four little games made in C / C++ (CSFML / SFML)

Graphical projects Name Language Grade Year My hunter C / CSFML B 2017 My runner C / CSFML B 2017 My world C / CSFML B 2018 My rpg C / CSFML A 2018 Re

Luis Rosario 11 Mar 30, 2021
🍦IceCream-Cpp is a little (single header) library to help with the print debugging on C++11 and forward.

??IceCream-Cpp is a little (single header) library to help with the print debugging on C++11 and forward.

Renato Garcia 383 Jun 25, 2022
a little hobby raspberry pi pico emulator

PICO-EMU a little raspberry pi pico emulator note: we use the provided bootrom from raspberry pi at the repo: https://github.com/raspberrypi/pico-boot

supercyp 21 Jun 5, 2022
The little C kit

ckit The little C kit bin/ckit — tool for building and testing projects (calls cmake & ninja) pkg/ — directory of some packages The main thing here is

Rasmus 42 May 19, 2022
Android Bindings for QuickJS, A fine little javascript engine.

quickjs-android quickjs-android 是 QuickJS JavaScript 引擎的 Android 接口框架,整体基于面向对象设计,提供了自动GC功能,使用简单。armeabi-v7a 的大小仅 350KB,是 Google V8 不错的替代品,启动速度比 V8 快,内

Wiki 91 Jun 9, 2022
httpserve - Spin up a little http server from the commandline.

httpserve - Spin up a little http server from the commandline.

James Barford-Evans 1 Aug 22, 2021
A little experiment to have multicore OCaml with effects on iOS. In particular the GCD backend for eio.

Effects on iOS Very WIP & Experimental Overview A little experiment to have multicore OCaml with effects on iOS (currently just the simulator). In par

Patrick Ferris 11 May 11, 2022
A handy little system information monitor using and ESP32 + ILI9488 TFT. Receives data over Serial Bluetooth.

Bluetooth-System-Monitor A handy little system information monitor using and ESP32 + ILI9488 TFT. Receives data over Serial Bluetooth and thus giving

Dustin Watts 24 May 28, 2022
a Little Computer 3 simulator

smol3 ??️ a Little Computer 3 simulator smol3 is a tiny LC3 simulator written in C. It aims to be fast and correct. TODO read input binary files write

pry 1 Oct 22, 2021