cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

HTTP request anwered and I'm not sure to save the outut (WAV file) in the right format

Hello, everybody,

I have an HTTP request using MS Flow to transcribe a text in language. This was executed and the status code of the request is 200, so the request call is ok. As a result I get a Json response which contains a WAV file. The content of content can be saved as a file. When playing the file I get the hint that the file format is not correct.

https://docs.microsoft.com/de-de/azure/cognitive-services/speech-service/rest-text-to-speech

Http request is:

{
    "inputs": {
        "method": "POST",
        "uri": "https://northeurope.tts.speech.microsoft.com/cognitiveservices/v1",
        "headers": {
            "Authorization": "Bearer @{body('HTTPToken')}",
            "X-Microsoft-OutputFormat": "@variables('OutputFormat')",
            "Content-type": "application/ssml+xml",
            "Content-Length": "@{length(variables('Text'))}"
        },
        "body": "@xml(variables('VAR_JSON'))"
    }
}

the answer is this:

 

{"statusCode":200,"headers":{"Transfer-Encoding":"chunked","X-MSEdge-Ref":"Ref A: FE3DE96789B14B8688AF716A71DA479A Ref B: AM3EDGE0514 Ref C: 2019-10-23T10:53:08Z","Date":"Wed, 23 Oct 2019 10:53:08 GMT","Content-Type":"audio/x-wav","Content-Length":"361714"},"body":{"$content-type":"audio/x-wav","$content":"UklGRuqEBQBXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YcaEBQAAAAAAAAAAAAAAAAAAAAAAAA .... here come many chars...  AAAAAAAAAAA=="}}
 

I don't know which formatting to use to save the content as a playable file.

 

I hope for an informative answer.

 

Many thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: HTTP request anwered and I'm not sure to save the outut (WAV file) in the right format

I found the mistake. It wasn't the data itself.  The error message that came up indicated that it was not possible to save the data in the original format.  The note with "Content-Type": "audio/x-wav"  in my opinion was related to the content itself.  This was not the case. Rather, the file could not be saved on the blob because the stored credentials for the bob do not work in the flow.  Only when I saved the login information for the file on the blob in MS Flow was it possible to save the file there and then it was playable.
therefore your post was helpful.
 

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User III
Dual Super User III

Re: HTTP request anwered and I'm not sure to save the outut (WAV file) in the right format

Hey @UIT 

 

You can try saving the file with a .mp3 extension. If it is being created on SharePoint, it can be played over there. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Frequent Visitor

Re: HTTP request anwered and I'm not sure to save the outut (WAV file) in the right format

I saved the outout one time with and one time without header in a mp3 file, but bott are not playable.

Highlighted
Dual Super User III
Dual Super User III

Re: HTTP request anwered and I'm not sure to save the outut (WAV file) in the right format

Hey @UIT 

 

Can you share a screenshot of the flow? what action are you using to save the file? You just have to add the .mp3 to the filename with extension part. If you can share a screenshot of the flow, we can better understand the issue and help you with this. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Frequent Visitor

Re: HTTP request anwered and I'm not sure to save the outut (WAV file) in the right format

I found the mistake. It wasn't the data itself.  The error message that came up indicated that it was not possible to save the data in the original format.  The note with "Content-Type": "audio/x-wav"  in my opinion was related to the content itself.  This was not the case. Rather, the file could not be saved on the blob because the stored credentials for the bob do not work in the flow.  Only when I saved the login information for the file on the blob in MS Flow was it possible to save the file there and then it was playable.
therefore your post was helpful.
 

View solution in original post

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (3,384)