This is a sample that drives a speaker with PWM.

Dependencies:   EasyPlayback

Fork of GR-PEACH_Audio_WAV by Renesas

This is a sample that drives a speaker with PWM. This sample will play a ".wav" file of the microSD or USB memory root folder. If the USER_BUTTON0 is pressed, the next song is played.

/media/uploads/dkato/pwm_speaker_img.png

FormatWav file (RIFF format) ".wav"
Channel1ch and 2ch
Frequencies32kHz, 44.1kHz and 48kHz
Quantization bit rate8bits and 16bits


You can adjust the volume by changing the following.

main.cpp

AudioPlayer.outputVolume(0.5);  // Volume control (min:0.0 max:1.0)


The default setting of serial communication (baud rate etc.) in mbed is shown the following link.
Please refer to the link and change the settings of your PC terminal software.
The default value of baud rate in mbed is 9600, and this application uses baud rate 9600.
https://developer.mbed.org/teams/Renesas/wiki/GR-PEACH-Getting-Started#install-the-usb-serial-communication

History

Changed to be usable with EasyPlayback default tip

2018-07-24, by dkato [Tue, 24 Jul 2018 08:46:48 +0000] rev 16

Changed to be usable with EasyPlayback


upports mbed-os 5.9.1 and later

2018-07-24, by dkato [Tue, 24 Jul 2018 05:45:07 +0000] rev 15

upports mbed-os 5.9.1 and later


Change volume

2017-07-06, by dkato [Thu, 06 Jul 2017 05:10:49 +0000] rev 14

Change volume


Simplified sample

2017-07-06, by dkato [Thu, 06 Jul 2017 04:50:46 +0000] rev 13

Simplified sample


Update library

2017-03-24, by dkato [Fri, 24 Mar 2017 06:56:45 +0000] rev 12

Update library


Supports mbed os 5.4.

2017-03-24, by dkato [Fri, 24 Mar 2017 04:30:17 +0000] rev 11

Supports mbed os 5.4.


Change volume setting.

2016-12-20, by dkato [Tue, 20 Dec 2016 07:28:04 +0000] rev 10

Change volume setting.


Changed to sample to drive the speaker with PWM.

2016-12-20, by dkato [Tue, 20 Dec 2016 05:41:42 +0000] rev 9

Changed to sample to drive the speaker with PWM.


Supports IAR.

2016-04-18, by dkato [Mon, 18 Apr 2016 09:17:50 +0000] rev 8

Supports IAR.


High-Resolution Audio

2015-08-18, by dkato [Tue, 18 Aug 2015 04:19:19 +0000] rev 7

High-Resolution Audio