ok put into USB device mode attach headset to analog out use control panel to set MBED as default output adjtst speaker volume to get sound play music
Fork of USBAUDIO_speaker by
Diff: main.cpp
- Revision:
- 2:c3edc567ae33
- Parent:
- 1:0335b5c18618
- Child:
- 3:41b10e311100
diff -r 0335b5c18618 -r c3edc567ae33 main.cpp --- a/main.cpp Wed Nov 30 10:25:25 2011 +0000 +++ b/main.cpp Wed Nov 30 10:29:23 2011 +0000 @@ -13,7 +13,7 @@ #define NB_CHA 1 // length of an audio packet: each ms, we receive 48 * 16bits ->48 * 2 bytes. as there is one channel, the length will be 48 * 2 * 1 -#define AUDIO_LENGTH_AUDIO_PACKET 48 * 2 * 1 +#define AUDIO_LENGTH_PACKET 48 * 2 * 1 // USBAudio USBAudio audio(FREQ, NB_CHA, 0x7180, 0x7500); @@ -25,7 +25,7 @@ Ticker tic; // buffer where will be store one audio packet (LENGTH_AUDIO_PACKET/2 because we are storing int16 and not uint8) -int16_t buf[AUDIO_LENGTH_AUDIO_PACKET/2]; +int16_t buf[AUDIO_LENGTH_PACKET/2]; // show if an audio packet is available volatile bool available = false; @@ -54,7 +54,7 @@ index_buf++; // if we have read all the buffer, no more data available - if (index_buf == AUDIO_LENGTH_AUDIO_PACKET/2) { + if (index_buf == AUDIO_LENGTH_PACKET/2) { index_buf = 0; available = false; }