cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UIT
Level: Powered On

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
UIT
Level: Powered On

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

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!

UIT
Level: Powered On

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.

Dual Super User
Dual Super User

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
UIT
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,880)