RCA analog audio to internal ADC to I2S #1683
-
I'm working with an ESP32 board. OBJECTIVE:The objective is to get an analog audio stream generated by another ESP32, (intended to be used as RCA cable type audio), passing it through the internal ADC, then filter it (as of now I'm not applying any filters, because I first want the thing to work), then output on an I2S bus (which finally passes through a DAC). WHAT WORKS:I've read the frequent issues page.
And I'm definitely getting some readings from GPIO34: WHAT DOESN'T WORKI came up with this sketch, which if I've understood everything correctly should just copy what's coming from the ADC to the DAC.
But now I can't hear anything coming out of the DAC. OTHER (hopefully useful) INFORMATION
Thanks a lot for reading. Any help will be widely appreciated :D |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Your CSVOutput has a bug: it must be <int16_t>. I also think you have a bug with the number of channels: if you record only on 1 pin you have a mono signal, so the number of channels should be 1 and not 2. Finally, I don't think you can use the internal DAC for this: but test this yourself by recording a sine wave. The goal is to see a proper 0 centered sine wave in the Arduino Serial Plotter. I expect that your ADC will only show the + part of the audio and cut off the - part of the sine wave... |
Beta Was this translation helpful? Give feedback.
-
To center the sine wave (for audio) you can use cfgRx.auto_center_read = true |
Beta Was this translation helpful? Give feedback.
Your CSVOutput has a bug: it must be <int16_t>. I also think you have a bug with the number of channels: if you record only on 1 pin you have a mono signal, so the number of channels should be 1 and not 2.
Finally, I don't think you can use the internal DAC for this: but test this yourself by recording a sine wave. The goal is to see a proper 0 centered sine wave in the Arduino Serial Plotter.
I expect that your ADC will only show the + part of the audio and cut off the - part of the sine wave...