Giter Club home page Giter Club logo

numaker-mbed-audio's Introduction

NuMaker-mbed-Audio

This library contains Mbed implementation of NuMaker Audio I2S and Codec.

Example: Play PCM data from SD card

  1. Declare NuSDBlockDevice and FATFileSystem.

    NuSDBlockDevice bd   // device SD driver
    FATFileSystem fs     // Mbed FAT file system
    
  2. Declare audio.

    NAU8822L audio  // NAU8822L object, I2C pinout/address and I2S pinout
    or
    NAU88L25 audio  // NAU88L25 object, I2C pinout/address and I2S pinout
    
  3. Attach callback function for playing.

    audio.attach(&play);
    
  4. Start audio.

    audio.start();
    
  5. Stop playing.

    audio.stop();
    
  6. Write PCM data to audio.

    audio.write
    

Example: Record PCM data to SD card

  1. Attach callback function for recording.

    audio.attach(&record);
    
  2. Record audio.

    audio.record();
    
  3. Stop recording.

    audio.stop();
    
  4. Read PCM data from audio.

    audio.read();
    

Notes:

  1. Smoothly playing or recording depends on the performance of SD card.

  2. Use FFmpeg to convert a PCM file.

    ffmpeg.exe -hide_banner -i audio_file -map_metadata -1 -flags +bitexact -vn -sn -c:a pcm_s16le -ac 1 -ar 8000 -f s16le test.pcm
    

numaker-mbed-audio's People

Contributors

csyang2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.