cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UIT
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
UIT
Frequent Visitor

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
yashag2255
Dual Super User II
Dual Super User II

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!

UIT
Frequent Visitor

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

yashag2255
Dual Super User II
Dual Super User II

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!

UIT
Frequent Visitor

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
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (31,587)