Skip to content

Commit 03cfbfd

Browse files
committed
audio: update examples
Signed-off-by: HiFiPhile <[email protected]>
1 parent 419aa29 commit 03cfbfd

File tree

17 files changed

+829
-1118
lines changed

17 files changed

+829
-1118
lines changed

examples/device/audio_4_channel_mic/src/main.c

Lines changed: 84 additions & 141 deletions
Large diffs are not rendered by default.

examples/device/audio_4_channel_mic_freertos/src/main.c

Lines changed: 115 additions & 174 deletions
Large diffs are not rendered by default.

examples/device/audio_test/src/main.c

Lines changed: 88 additions & 126 deletions
Large diffs are not rendered by default.

examples/device/audio_test/src/plot_audio_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
# print(sd.query_devices())
1313

1414
fs = 48000 # Sample rate
15-
duration = 100e-3 # Duration of recording
15+
duration = 3 # Duration of recording
1616

1717
if platform.system() == 'Windows':
1818
# MME is needed since there are more than one MicNode device APIs (at least in Windows)
19-
device = 'Microphone (MicNode) MME'
19+
device = 'Microphone (MicNode), Windows WASAPI'
2020
elif platform.system() == 'Darwin':
2121
device = 'MicNode'
2222
else:

examples/device/audio_test/src/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ extern "C" {
117117
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below - be aware: for different number of channels you need another descriptor!
118118
#define CFG_TUD_AUDIO_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
119119
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
120-
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (TUD_OPT_HIGH_SPEED ? 8 : 1) * CFG_TUD_AUDIO_EP_SZ_IN // Example write FIFO every 1ms, so it should be 8 times larger for HS device
120+
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (TUD_OPT_HIGH_SPEED ? 32 : 4) * CFG_TUD_AUDIO_EP_SZ_IN // Example write FIFO every 1ms, so it should be 8 times larger for HS device
121121

122122
#ifdef __cplusplus
123123
}

0 commit comments

Comments
 (0)