Samuel Mokrani
/
USBAudio_micro
USBAudio example using a microphone
Diff: main.cpp
- Revision:
- 8:caede7b4c444
- Parent:
- 7:6b0012b8fd01
- Child:
- 9:9de252a14cde
--- a/main.cpp Tue Dec 20 11:41:31 2011 +0000 +++ b/main.cpp Wed Dec 21 10:43:57 2011 +0000 @@ -1,5 +1,5 @@ #include "mbed.h" -#include "USBAudioOUT.h" +#include "USBAudio.h" // frequency: 8 kHz #define FREQ 8000 @@ -10,14 +10,15 @@ // 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_PACKET (FREQ/500) * NB_CHA -USBAudioOUT audio(FREQ, NB_CHA, 0x1111, 0x78ab); +USBAudio audio(FREQ, NB_CHA, 0x1007, 0xa455); AnalogIn mic(p20); int16_t buf[AUDIO_LENGTH_PACKET/2]; int main() { - double mic_mean = 0.0; + while(1); + /*double mic_mean = 0.0; double mic_value; // compute average value of the microphone. We can then center the audio signal sent to the computer @@ -34,5 +35,5 @@ } } audio.write((uint8_t *)buf); - } + }*/ }