I try to use Microsoft Translator Speech API . I am using c++ websocketpp
, I confirm that I have sent the audio data to server,but wait two minutes, the connection closed, because no audio is received from the client for an extended period of time.
void on_open(websocketpp::connection_hdl hdl) {
m_open = std::chrono::high_resolution_clock::now();
std::ifstream f("./HelloWorld.wav");
std::string str((std::istreambuf_iterator<char>(f)),std::istreambuf_iterator<char>())
m_endpoint.send(hdl,str,websocketpp::frame::opcode::BINARY);
}
Why?
Who can help me?
Thank you and regards.
Send data:
Wait two minutes:
emmmm,I solved the question,we need to add some silences at the end to tell the service that it is the end of the sentences.We make sure they are 0x00 byte,I made a mistake ,the data sent comes with additional information---pointer? Modify this error,I got a correct return.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.