pschatzmann / arduino-audio-tools

Arduino Audio Tools (a powerful Audio library not only for Arduino)
GNU General Public License v3.0
1.47k stars 227 forks source link

The example "streams-azure_tts-i2s" cannot run : write to target has failed! #940

Closed cnbluesky closed 1 year ago

cnbluesky commented 1 year ago

Hi Phil,

Thank you for your library. I have downloaded the example code, but I am facing a problem. I cannot hear any sound when running the code. The log is showing the following error: Could you please provide some advice on how to solve this issue? Thank you,

PS:The Wire and GPIO is ok, I can play voice with the udp stream example.

21:13:54:717 -> [ 5684][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 53 bytes... 21:13:54:717 -> [I] HttpHeader.h : 196 - -> X-Microsoft-OutputFormat: riff-16khz-16bit-mono-pcm 21:13:54:728 -> [ 5699][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 51 bytes... 21:13:54:739 -> [I] HttpHeader.h : 196 - -> User-Agent: Arduino with Audiotools version:0.9.4 21:13:54:739 -> [ 5714][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 21 bytes... 21:13:54:750 -> [I] HttpHeader.h : 196 - -> Content-Length: 137 21:13:54:750 -> [ 5729][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 39 bytes... 21:13:54:761 -> [I] HttpHeader.h : 196 - -> Host: eastus.tts.speech.microsoft.com 21:13:54:774 -> [ 5741][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 19 bytes... 21:13:54:774 -> [I] HttpHeader.h : 196 - -> Connection: close 21:13:54:783 -> [ 5755][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 19 bytes... 21:13:54:783 -> [I] HttpHeader.h : 196 - -> Accept: audio/wav 21:13:54:794 -> [ 5767][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 36 bytes... 21:13:54:794 -> [I] HttpHeader.h : 196 - -> Content-Type: application/ssml+xml 21:13:54:805 -> [ 5778][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 2 bytes... 21:13:54:817 -> [I] HttpHeader.h : 304 - -> 21:13:54:817 -> [I] HttpRequest.h : 208 - Writing data: 137 bytes 21:13:54:817 -> [ 5792][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 137 bytes... 21:13:54:828 -> [I] HttpRequest.h : 287 - Request written ... waiting for reply 21:13:54:836 -> [I] HttpHeader.h : 229 - HttpHeader::read 21:13:54:836 -> [W] HttpHeader.h : 236 - Waiting for data... 21:13:55:341 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> HTTP/1.1 200 OK 21:13:55:352 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> Date: Sun, 23 Jul 2023 13:13:55 GMT 21:13:55:363 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> Content-Type: audio/x-wav 21:13:55:363 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> Transfer-Encoding: chunked 21:13:55:374 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> Connection: close 21:13:55:374 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> x-envoy-upstream-service-time: 132 21:13:55:385 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> Strict-Transport-Security: max-age=15724800; includeSubDomains 21:13:55:396 -> [I] HttpHeader.h : 166 - HttpHeader::readLine -> 21:13:55:396 -> [W] HttpRequest.h : 180 - no CONTENT_LENGTH found in reply 21:13:55:407 -> [I] URLStream.h : 110 - size: 0 21:13:55:407 -> [I] URLStream.h : 346 - virtual bool audio_tools::URLStream::waitForData() 21:13:55:418 -> [I] URLStream.h : 358 - available: 3922 21:13:55:418 -> [I] StreamCopy.h : 305 - try write - 2 (open 1024 bytes) 21:13:55:418 -> [I] StreamCopy.h : 305 - try write - 3 (open 1024 bytes) 21:13:55:429 -> [I] StreamCopy.h : 305 - try write - 4 (open 1024 bytes) 21:13:55:429 -> [I] StreamCopy.h : 305 - try write - 5 (open 1024 bytes) 21:13:55:440 -> [I] StreamCopy.h : 305 - try write - 6 (open 1024 bytes) 21:13:55:440 -> [I] StreamCopy.h : 305 - try write - 7 (open 1024 bytes) 21:13:55:452 -> [I] StreamCopy.h : 305 - try write - 8 (open 1024 bytes) 21:13:55:452 -> [I] StreamCopy.h : 305 - try write - 9 (open 1024 bytes) 21:13:55:463 -> [I] StreamCopy.h : 305 - try write - 10 (open 1024 bytes) 21:13:55:463 -> [I] StreamCopy.h : 305 - try write - 11 (open 1024 bytes) 21:13:55:474 -> [I] StreamCopy.h : 305 - try write - 12 (open 1024 bytes) 21:13:55:474 -> [I] StreamCopy.h : 305 - try write - 13 (open 1024 bytes) 21:13:55:485 -> [I] StreamCopy.h : 305 - try write - 14 (open 1024 bytes) 21:13:55:485 -> [I] StreamCopy.h : 305 - try write - 15 (open 1024 bytes) 21:13:55:485 -> [I] StreamCopy.h : 305 - try write - 16 (open 1024 bytes) 21:13:55:496 -> [I] StreamCopy.h : 305 - try write - 17 (open 1024 bytes) 21:13:55:496 -> [I] StreamCopy.h : 305 - try write - 18 (open 1024 bytes) 21:13:55:507 -> [I] StreamCopy.h : 305 - try write - 19 (open 1024 bytes) 21:13:55:507 -> [I] StreamCopy.h : 305 - try write - 20 (open 1024 bytes) 21:13:55:518 -> [I] StreamCopy.h : 305 - try write - 21 (open 1024 bytes) 21:13:55:518 -> [E] StreamCopy.h : 299 - write to target has failed! (1024 bytes) 21:13:55:529 -> [I] StreamCopy.h : 139 - StreamCopy::copy 1024 -> 1024 -> 0 bytes - in 22 hops 21:13:55:542 -> [I] StreamCopy.h : 305 - try write - 2 (open 1024 bytes) 21:13:55:553 -> [I] StreamCopy.h : 305 - try write - 3 (open 1024 bytes) 21:13:55:553 -> [I] StreamCopy.h : 305 - try write - 4 (open 1024 bytes) 21:13:55:564 -> [I] StreamCopy.h : 305 - try write - 5 (open 1024 bytes) 21:13:55:564 -> [I] StreamCopy.h : 305 - try write - 6 (open 1024 bytes) 21:13:55:578 -> [I] StreamCopy.h : 305 - try write - 7 (open 1024 bytes) 21:13:55:578 -> [I] StreamCopy.h : 305 - try write - 8 (open 1024 bytes) 21:13:55:586 -> [I] StreamCopy.h : 305 - try write - 9 (open 1024 bytes) 21:13:55:586 -> [I] StreamCopy.h : 305 - try write - 10 (open 1024 bytes) 21:13:55:597 -> [I] StreamCopy.h : 305 - try write - 11 (open 1024 bytes) 21:13:55:597 -> [I] StreamCopy.h : 305 - try write - 12 (open 1024 bytes) 21:13:55:609 -> [I] StreamCopy.h : 305 - try write - 13 (open 1024 bytes) 21:13:55:609 -> [I] StreamCopy.h : 305 - try write - 14 (open 1024 bytes) 21:13:55:620 -> [I] StreamCopy.h : 305 - try write - 15 (open 1024 bytes) 21:13:55:620 -> [I] StreamCopy.h : 305 - try write - 16 (open 1024 bytes) 21:13:55:620 -> [I] StreamCopy.h : 305 - try write - 17 (open 1024 bytes) 21:13:55:631 -> [I] StreamCopy.h : 305 - try write - 18 (open 1024 bytes) 21:13:55:631 -> [I] StreamCopy.h : 305 - try write - 19 (open 1024 bytes) 21:13:55:642 -> [I] StreamCopy.h : 305 - try write - 20 (open 1024 bytes) 21:13:55:642 -> [I] StreamCopy.h : 305 - try write - 21 (open 1024 bytes) 21:13:55:653 -> [E] StreamCopy.h : 299 - write to target has failed! (1024 bytes) 21:13:55:653 -> [I] StreamCopy.h : 139 - StreamCopy::copy 1024 -> 1024 -> 0 bytes - in 22 hops 21:13:55:674 -> [I] StreamCopy.h : 305 - try write - 2 (open 1024 bytes)

pschatzmann commented 1 year ago

Since I don't have any azure account, I can't really help. Did you check with wget or curl that you get a valid wav file as result with the parameters that you have entered?