Unverified Commit 90fd4412 authored by Wolle's avatar Wolle Committed by GitHub

fix google-tts,not recgnized end of speech #366

parent ea36183d
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* Created on: Oct 26.2018 * Created on: Oct 26.2018
* *
* Version 2.0.6b * Version 2.0.6c
* Updated on: Sep 01.2022 * Updated on: Sep 05.2022
* Author: Wolle (schreibfaul1) * Author: Wolle (schreibfaul1)
* *
*/ */
...@@ -760,7 +760,7 @@ bool Audio::connecttospeech(const char* speech, const char* lang){ ...@@ -760,7 +760,7 @@ bool Audio::connecttospeech(const char* speech, const char* lang){
} }
_client->print(resp); _client->print(resp);
m_streamType = ST_WEBSTREAM; m_streamType = ST_WEBFILE;
m_f_running = true; m_f_running = true;
m_f_ssl = false; m_f_ssl = false;
m_f_tts = true; m_f_tts = true;
...@@ -852,7 +852,7 @@ bool Audio::connecttomarytts(const char* speech, const char* lang, const char* v ...@@ -852,7 +852,7 @@ bool Audio::connecttomarytts(const char* speech, const char* lang, const char* v
} }
_client->print(resp); _client->print(resp);
m_streamType = ST_WEBSTREAM; m_streamType = ST_WEBFILE;
m_f_running = true; m_f_running = true;
m_f_ssl = false; m_f_ssl = false;
m_f_tts = true; m_f_tts = true;
...@@ -3054,7 +3054,7 @@ void Audio::processWebFile() { ...@@ -3054,7 +3054,7 @@ void Audio::processWebFile() {
audioDataCount = 0; audioDataCount = 0;
} }
if(!m_contentlength) {log_e("webfile without contentlength!"); stopSong(); return;} // guard if(!m_contentlength && !m_f_tts) {log_e("webfile without contentlength!"); stopSong(); return;} // guard
uint32_t availableBytes = _client->available(); // available from stream uint32_t availableBytes = _client->available(); // available from stream
...@@ -3063,6 +3063,7 @@ void Audio::processWebFile() { ...@@ -3063,6 +3063,7 @@ void Audio::processWebFile() {
uint8_t readedBytes = 0; uint8_t readedBytes = 0;
if(!chunkSize) chunkSize = chunkedDataTransfer(&readedBytes); if(!chunkSize) chunkSize = chunkedDataTransfer(&readedBytes);
availableBytes = min(availableBytes, chunkSize); availableBytes = min(availableBytes, chunkSize);
if(m_f_tts) m_contentlength = chunkSize;
} }
// if the buffer is often almost empty issue a warning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // if the buffer is often almost empty issue a warning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Audio.h * Audio.h
* *
* Created on: Oct 28,2018 * Created on: Oct 28,2018
* Updated on: Sep 01,2022 * Updated on: Sep 05,2022
* Author: Wolle (schreibfaul1) * Author: Wolle (schreibfaul1)
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment