Giter Club home page Giter Club logo

wavplayer's Introduction

wavplayer

中文页 | English

1. Introduction

wavplayer is a simple wav format music player that provides functions for playing and recording wav files, supporting functions such as play, stop, pause, resume, and volume adjustment.

1.1. File structure

Folder Description
src Core source code, which mainly implements wav playback and recording, and export Finsh command line
inc Header file directory

1.2 License

The wavplayer package complies with the Apache 2.0 license, see the LICENSE file for details.

1.3 Dependency

  • RT-Thread 4.0+
  • RT-Thread Audio driver framework
  • optparse command line parameter parsing package

1.4 Configuration Macro Description

 --- WavPlayer: Minimal music player for wav file play and record.
 [*] Enable support for play
 (sound0) The play device name
 [*] Enable support for record
 (sound0) The record device name
       Version (v1.0.0) --->

Enable support for play: enable wav play function The play device name: Specify the sound card device used for playback, default sound0 Enable support for record: enable wav recording function The record device name: Specify the sound card device used for recording, the default is the same as the playback, use sound0.

2. Use

Common functions of wavplayer have been exported to Finsh command line for developers to test and use. Commands are mainly divided into two categories: playback and recording, which provide different functions.

The functions provided by the play command are as follows

msh />wavplay -help
usage: wavplay [option] [target] ...

usage options:
  -h, --help Print defined help message.
  -s URI, --start=URI Play wav music with URI(local files).
  -t, --stop Stop playing music.
  -p, --pause Pause the music.
  -r, --resume Resume the music.
  -v lvl, --volume=lvl Change the volume(0~99).
  -d, --dump Dump play relevant information.

The functions provided by the recording command are as follows

msh />wavrecord -h
usage: wavrecord [option] [target] ...

usage options:
  -h, --help Print defined help message.
  -s file --start=file <samplerate> <channels> <samplebits>
                                        record wav music to filesystem.
  -t, --stop Stop record.

2.1 Play function

  • Start playing
msh />
msh />wavplay -s song_44.wav
Information:
sampletate 44100
channels 2
sample bits width 16
[I/WAV_PLAYER] play start, uri=song_44.wav
  • Stop play
msh />wavplay -t
[I/WAV_PLAYER] play end
  • Pause playback
msh />
msh />wavplay -p
msh />
  • Resume playback
msh />
msh />wavplay -r
msh />
  • Set volume
msh />
msh />wavplay -v 88
msh />

2.2 Recording function

  • start recording
msh />wavrecord -s test.wav
Information:
sampletate 8000
channels 2
  • Stop recording
msh />
msh />wavrecord -t
msh />

3. Matters needing attention

  • Only supports audio with 16bit sampling bits

4. Contact

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.