Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reason why 1.0.6 was/is needed in STT ESP32 - i2s_read_bytes() no longer supported #11

Open
kaloprojects opened this issue May 5, 2024 · 0 comments

Comments

@kaloprojects
Copy link

kaloprojects commented May 5, 2024

Hi techiesms,

=== BUG FIX:

your left ESP (STT/SpeechToText) script requires 1.0.6 .. BUT the problem is: many newer ESP32 need the latest 2.0.14 (or later) otherwise the right 'TextToSpeech (TTS)' ESP32 raises lot of compiling errors (1.0.6 does not work on many TTS ESP32). See here: techiesms/ESP32-ChatGPT-V2#1.
So it is a pretty nightmare as i have to install the old 1.0.6 on compiling the 1st STT ESP and the newer 2.0.14 for the 2nd TTS) ESP :|

So i checked for the root cause WHY your left (STT) ESP2 (from [MhageGH]) needs the old 1.6.0' ESP library, here it is:

On bottom of 'I2S.cpp' script is a function ' i2s_read_bytes()' called, which is depreciated meanwhile (Legacy) ad has to replaced with the function call ' 'i2s_read()'. More details see here: https://docs.espressif.com/projects/esp-idf/en/v3.3/api-reference/peripherals/i2s.html

So i replaced one line
'return i2s_read_bytes(I2S_NUM_0, (char *)data, numData, portMAX_DELAY);'
with:
'size_t bytes_read = 0; return i2s_read(I2S_NUM_0, (char *)data, numData, &bytes_read, portMAX_DELAY);

.. and all Compile error are solved ;) .. even with new 2.0.14 library .. Test it !

It still does not work (no compiling error BUT recording not working), i might test again, maybe other folks will find the last needed trick (assumung the amount of bytes missed, 0 seems wrong) , all ideas welcome

kalo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant