中文页 | English
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.
Folder | Description |
---|---|
src | Core source code, which mainly implements wav playback and recording, and export Finsh command line |
inc | Header file directory |
The wavplayer package complies with the Apache 2.0 license, see the LICENSE
file for details.
- RT-Thread 4.0+
- RT-Thread Audio driver framework
- optparse command line parameter parsing package
--- 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
.
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.
- 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 />
- start recording
msh />wavrecord -s test.wav
Information:
sampletate 8000
channels 2
- Stop recording
msh />
msh />wavrecord -t
msh />
- Only supports audio with 16bit sampling bits
- Maintenance: Zero-Free
- Homepage: https://github.com/RT-Thread-packages/wavplayer