Simple Wave Player with PWM, Lite version.

Dependencies:   mbed


Under construction



  • This is a simple wave player application(not library) using PWM ports.
  • This is Lite version.
    (difference from
  • Speed up SD card accsess by modified SDFileSystem library with DMA capability.
  • Only very simple User Interfaces.
  • 32 step digital volume capability. (New feature)
  • Variable speed functionality to play. (Up usability)
  • 10bit PWM resolution quality. (Decent audio quality)
  • Small code size. (About 32K byte)
  • LED indicator while playing music. (New feature / (Inaccurate :D ))
  • Using only passive electric components except SD card.
    ( It is needed only some resisters and capacitors )


  • Input data: WAVE file(PCM:*.wav files). ( must be converted by foobar2000)
  • Data length: 16bit, 8bit.
  • fs : ... 32kHz,44.1kHz,48kHz.
  • Channel: Stereo, mono
  • Output data: PWM 10bit resolutuon.
    fs and Channels are the same as input data.


Using Library

Terminal base CUI

UART Terminal (e.g. Tera Term) base operation, /media/uploads/mimi3/wave_player_pwm_lite_cui_terminal.png

Tera Tem settings

  • Serial om port: Baudrate 115200bps.
  • Main Menu - [Setup] - [Terminal] dialog:

New-line settings.



KeyOperationon Playon Pause
p,sPause or Play.PausePlay
., n, SpaceNext song.oo
dPlay slowly 3 step.oo
uPlay rappidly 3 step.oo
0(Zero)Set normal play speed.oo
+,-Digital Volume 32 stepoo
hHelp menu.-o
!Show system information.oo
qQuit player mode.oo

Playing music

Now You can hear the sound from PWM port of mbed board.

Music01: Serenity

Music02: About That Oldie

Music03: Gemini Robot

Download repository: zip gz

Files at revision 0:b5e8059dd716

Name Size Actions
main.cpp 214 Revisions Annotate
mbed.bld 65 Revisions Annotate