Skip to content

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

@kaloprojects

Description

@kaloprojects

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions