Capture audio doubt - How buffer is filled #1938
-
Hello @pschatzmann, I have a doubt about read function to recover capture samples from ES8388. For example: The READ function wait for fill buffer complete (until samples defined by BUFFER_SIZE_REC) or when I call READ, get until then all bytes that it could capture? Is there any example that uses that function and later processed all content buffer, on continuos capturing, without samples lossing? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 39 replies
-
Please read the first Introduction Wiki: there is no read(bufferRecCopy, BUFFER_SIZE_REC); method! The Method from the Arduino Stream API is readBytes(buffer, size) and provides the requested bytes (or to be avoided read() which provides one single byte). If is used in all examples as part of the StreamCopy as descirbed in the Wiki |
Beta Was this translation helpful? Give feedback.
-
I'm going to try to do some more tests. Can these includes coexist together? When I try to use "AudioBoardStream" compiler out a lot of errors, even removing the Audiokit.h, too. Do I need anything else additional to the AudioBoardStream installed on my project (I use VSCode and platformIO) to detect drivers or something about? |
Beta Was this translation helpful? Give feedback.
-
I am sorry, but I don't follow the PlatformIO releases and you will need to find out yourself what IDF release is behind them. Arduino ESP32 3.2 -> IDF 5.4 Please note that it is the IDF that provides the basic I2S API and functionality. |
Beta Was this translation helpful? Give feedback.
-
Hello @pschatzmann I'm updating my code and using I2SCodecStream like a example that you recomend me. With 1.0.1 library compiler returns me the following message, #include "AudioTools.h" Can you help me? |
Beta Was this translation helpful? Give feedback.
-
I am not sure about the implications of allowing a copy of the I2SCodecStream: so I recommend to avoid to do this! |
Beta Was this translation helpful? Give feedback.
-
Hi @pschatzmann. At the end the issue was discovered. The source wave was generating as PWM signal. The only monitor that I had was Audacity. It seems that Audacity or my Sound capture board was converting PWM wave and I only was seeing a perfect square wave, but Audiokit was back crazy because was interpreting a PWM wave as normal square wave. Was the reason that wave was distorsioned. Now all is ok, and works fine, after I know this peculiarity of my equipment. I have been capturing some cassettes through old tape player and works fine. The source volume need a special attention due to be amplified but I'm happy with the results. Thanks for your support. |
Beta Was this translation helpful? Give feedback.
Please read the first Introduction Wiki: there is no read(bufferRecCopy, BUFFER_SIZE_REC); method!
The Method from the Arduino Stream API is readBytes(buffer, size) and provides the requested bytes (or to be avoided read() which provides one single byte).
If is used in all examples as part of the StreamCopy as descirbed in the Wiki