AI-Thinker ES8388 as MP3 player with enabled microphones in RXTX_MODE, confusion with stereo / mono playback and recording #1711
-
Hi! I am a little bit confused, so maybe someone can help me out with the following setup:
MP3 playback works without problems. As far as I understood is the AudioInfo of the board defined by the source data of the player, so for instance when playing a 44100hz 16bit stereo song the AudioBoardStream is set to this AudioInfo. So changing the sample rate with defferent songs / playbacks automatically changes the recording sampling rate, right? What is more confusing here is the input_device. In my setup only one mic is active, but when playing a stereo song on the AudioPlayer I see two channels in the AudioInfo. debug So is the recording data stream in this setup now stereo or mono? I need to convert the recording data stream to a fixed sampling rate (13000hz) / 16 bit / 1 channel config, I know how to use the FormatConverterStream, but I am not sure what is the correct description of the source data in terms of channels etc. in my setup. When I pass in the AudioInfo from the board (with 2 channels) as "from" voices in the output of the format converter sound like mickey mouse, so far too high. So I think there is something wrong with either the channels or the sampling rate, and maybe also with my assumptions about all of this. Another thing I have noted is that the microphone recording level is quite low. Is is possible to modify the microphone gain somehow? Thank you all, I know this is either confusing, I am confused, or maybe both. MIrko |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Yes the I2S is usually notified by audio format changes from the decoder. see this Wiki As far as I understand,with your configuration both microphones are enabled. However you can force the system to use mono by setting channels = 1; Or you can leave them to stereo and at the output stage mix them down to 1 with a FormatConverterStream or better a ChannelFormatConverterStream. The ES8388 driver supports to set the microphone gain with the setInputVolume() method. Finally: since the input and output are using the same I2S interface, the data format settings are shared betwen them. |
Beta Was this translation helpful? Give feedback.
-
This seems to be a bug: I committed a correction. For the AudioKit ADC_INPUT_LINE2 is both microphones and ADC_INPUT_LINE1 aux input! |
Beta Was this translation helpful? Give feedback.
-
You can easily test the microphons with this sketch |
Beta Was this translation helpful? Give feedback.
Yes the I2S is usually notified by audio format changes from the decoder. see this Wiki
As far as I understand,with your configuration both microphones are enabled. However you can force the system to use mono by setting channels = 1; Or you can leave them to stereo and at the output stage mix them down to 1 with a FormatConverterStream or better a ChannelFormatConverterStream.
The ES8388 driver supports to set the microphone gain with the setInputVolume() method.
Finally: since the input and output are using the same I2S interface, the data format settings are shared betwen them.