96kHz-16bit USB Audio Output interface with UDA1345 and 24.576MHz Xtal.

Dependencies:   I2S USBDevice mbed

Fork of USBAudioPlayback by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
edy555
Date:
Tue Feb 04 15:35:52 2014 +0000
Parent:
3:44343b9dd8b6
Child:
5:ca2316551f3d
Commit message:
remote input channel, reduce buffer size, change used api from readWrite to read

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Feb 04 15:22:19 2014 +0000
+++ b/main.cpp	Tue Feb 04 15:35:52 2014 +0000
@@ -10,7 +10,7 @@
 
 // 2channels: stereo
 #define NB_CHA_SPK 2
-#define NB_CHA_MIC 1
+#define NB_CHA_MIC 0
 
 // length computed: each ms, we receive 48 * 16bits ->48 * 2 bytes. as there are two channels, the length will be 48 * 2 * 2
 #define LENGTH_AUDIO_PACKET_SPK (FREQ_SPK / 500) * NB_CHA_SPK
@@ -24,7 +24,7 @@
 I2S i2s(I2S_TRANSMIT, p5, p6, p7);
 I2S i2srx(I2S_RECEIVE, p8, p29, p15);
 
-#define CHUNKS 64
+#define CHUNKS 6
 
 int buf_out[LENGTH_AUDIO_PACKET_MIC/sizeof(int)];
 int16_t buf_in[CHUNKS][LENGTH_AUDIO_PACKET_SPK/sizeof(int16_t)];
@@ -74,7 +74,7 @@
     i2s.start();
 
     while (1) {
-        audio.readWrite((uint8_t *)buf_in[read_pos++], (uint8_t *)buf_out);
+        audio.read((uint8_t *)buf_in[read_pos++]);
         read_pos %= CHUNKS;
         if (stream_in == NULL && read_pos > CHUNKS / 2) {
             stream_in = buf_in[write_pos];