-
-
Notifications
You must be signed in to change notification settings - Fork 309
Examples
All examples follow the following naming convention: "scenario type"-"source"-"destination". For the scenario types we might have base (using basic api functionality), stream for examples using Streams and test for the test cases.
For the source we currently have adc for analog input devices like analog microphones, i2s for digital input devices (e.g. digital microphones), file for SD files and a2dp for input from Bluetooth A2DP (e.g. from a Mobile Phone).
For the destination we use dac for analog output (e.g. to an amplifier), i2s for digital output devices (e.g. an external DAC), file for SD files and a2dp for output to Bluetooth A2DP (e.g. a Bluetooth Speaker).
Here is the list of examples:
Here are a couple of simple test sketches to demo different output destinations:
- streams-generator-serial Displaying generated sound on the Serial Plotter
- streams-generator-i2s Output of generated sound on external DAC via I2S
- streams-generator-dac Output of generated sound on ESP32 internal DAC via I2S
- streams-generator-a2dp Output of generated sound on Bluetooth Speaker using A2DP
- streams-generator-pwm Output of generated sound with PWM
- streams-adc-serial Displaying input from analog microphone on the Serial Plotter
- streams-memory_wav-serial Decoding of WAV from Flash memory and display on the Serial Plotter
And some more useful examples:
- streams-memory_raw-i2s - Play music form Flash Memory via I2S to External DAC
- streams-url_raw-serial Displaying a music file from the internet on the Serial Plotter
- streams-url_raw-I2S.ino Streaming a File from the Internet to on external DAC via I2S
- streams-url_wav-i2s Text to Speach example using Rhasspy
... these are just a few examples, but you can combine any Input Stream with any Output Stream as you like...
I am also providing a simple webserver which can render the audio data as wav result. Here are some examples:
- streams-generator-webserver_wav A Webserver which renders some generated sound
- streams-sam-webserver_wav A Webserver which renders the result from the SAM TTS engine
- streams-tts-webserver_wav A Webserver which renders the result from the Arduino TTS engine
- streams-flite-webserver_wav A Webserver which renders the result from the Flite TTS engine
I recommend to use the Stream API instead of the Basic API. Anyhow here are some examples:
- base-adc-serial - Sample analog sound and write it to Serial
- base-adc-a2dp - Sample analog sound and write it to a A2DP Bluetooth source
- base-file_raw-serial - Read Raw File from SD card to and write it to Serial
- base-file_raw-a2dp - Read Raw File from SD card write it A2DP Bluetooth
- base-file_mp3-a2dp - Stream MP3 File from SD card to A2DP Bluetooth using the ESP8266Audio library
- base-i2s-serial - Sample digital sound and write it to Serial
- base-i2s-a2dp - Sample analog sound and write it to a A2DP Bluetooth source