This is a sample that drives a speaker with PWM.
Fork of GR-PEACH_Audio_WAV by
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.
| Format | Wav file (RIFF format) ".wav" |
| Channel | 1ch and 2ch |
| Frequencies | 32kHz, 44.1kHz and 48kHz |
| Quantization bit rate | 8bits 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
Revision 8:7121197d098e, committed 2016-04-18
- Comitter:
- dkato
- Date:
- Mon Apr 18 09:17:50 2016 +0000
- Parent:
- 7:4b6799c255ea
- Child:
- 9:c7c0a97fdb7f
- Commit message:
- Supports IAR.
Changed in this revision
--- a/R_BSP.lib Tue Aug 18 04:19:19 2015 +0000 +++ b/R_BSP.lib Mon Apr 18 09:17:50 2016 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/Renesas/code/R_BSP/#1390bfcb667c +http://developer.mbed.org/teams/Renesas/code/R_BSP/#c5c630882b90
--- a/TLV320_RBSP.lib Tue Aug 18 04:19:19 2015 +0000 +++ b/TLV320_RBSP.lib Mon Apr 18 09:17:50 2016 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/Renesas/code/TLV320_RBSP/#b1fab4a2b59d +http://developer.mbed.org/teams/Renesas/code/TLV320_RBSP/#15487e571d9f
--- a/USBHost.lib Tue Aug 18 04:19:19 2015 +0000 +++ b/USBHost.lib Mon Apr 18 09:17:50 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/USBHost/#220cd93c9a5f +http://mbed.org/users/mbed_official/code/USBHost/#028508fd50fa
--- a/main.cpp Tue Aug 18 04:19:19 2015 +0000
+++ b/main.cpp Mon Apr 18 09:17:50 2016 +0000
@@ -21,8 +21,13 @@
#define FLD_PATH "/usb/"
//4 bytes aligned! No cache memory
+#if defined(__ICCARM__)
+#pragma data_alignment=4
+static uint8_t audio_write_buff[AUDIO_WRITE_BUFF_NUM][AUDIO_WRITE_BUFF_SIZE]@ ".mirrorram";
+#else
static uint8_t audio_write_buff[AUDIO_WRITE_BUFF_NUM][AUDIO_WRITE_BUFF_SIZE]
__attribute((section("NC_BSS"),aligned(4)));
+#endif
//Tag buffer
static uint8_t title_buf[TEXT_SIZE];
static uint8_t artist_buf[TEXT_SIZE];
--- a/mbed.bld Tue Aug 18 04:19:19 2015 +0000 +++ b/mbed.bld Mon Apr 18 09:17:50 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/b9ad9a133dc7 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f \ No newline at end of file
