Serial PCM Audio to and from AnalogAudioStream ESP32 #1769
-
I am have a project that I am trying to run on the ESP32. I have a couple of fundamental pain points as I learn to use this library. ProjectYou can take a look at my embedded code for this project here: https://github.com/wsciaroni/wsciaroni_kv4p-ht/blob/d6fd7c3e870ea084421675657cef2f4eceb9f21a/wsciaroni_kv4p-ht.ino Currently, I have a GeneratedStream just to put audio through, but that is just for testing. Project Requirements
I want two modes for this. Either rx or tx. In RX mode, I want to use the AudioTools library to read from the built in Analog to Digital converter. I want to use the AudioTools library to automatically send this audio stream to the serial port in 8 Bit PCM format. No separators. In TX mode, I want to manually add bytes to an AudioTools BufferedAudioStream. I want to use the AudioTools library to automatically send this audio stream to the built in Digital to Analog converter. I will put the bytes on the stream as I read them from 8 BitPCM coming in from Serial. When in Tx mode, the rx audio should not be sent. The Serial communication will come in the following format:
I think I want to use an I don't think I can begin the AnalogAudioStream In in RX_MODE and AnalogAudioStream Out int TX_MODE at the same time due to the underlying implementation. Questions
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 26 replies
-
You would use an EncodedAudioStream with an 8 bit codec! I think your sample rate is a bit high for Serial: you need to use > 396900 baud I think there are some examples in the communction folder! |
Beta Was this translation helpful? Give feedback.
-
You can use any pin with SoftwareSerial |
Beta Was this translation helpful? Give feedback.
You would use an EncodedAudioStream with an 8 bit codec!
You can directly use Serial as source and destination...
I think your sample rate is a bit high for Serial: you need to use > 396900 baud
I think there are some examples in the communction folder!