Forum Discussion
Azure OpenAI Whisper From Power Automate
Hello Richard_Wray
api-version in your URI is incorrected.
api-version should be 2024-02-01
Like this.
https://azureopenaispeechjuneeastus2.openai.azure.com/openai/deployments/wmcazureopenaiwhisper/audio/transcriptions?api-version=2024-02-01
Thanks,
Yoshihiko Muto(@ymuto)
- Richard_WrayJun 14, 2024Copper Contributor
Thanks. I actually cracked it in the end (found a blog, that I can't find now 😞 ). You are correct. The line should have read 'https://azureopenaispeechjuneeastus2.openai.azure.com/openai/deployments/wmcazureopenaiwhisper/audio/transcriptions?api-version=2024-02-01'
Here's the full flow to pass the contents from a Power App Mic control to Azure OpenAI Whisper and then pass the transcribed text back to the Power App. In this case the flow is called 'AzureTextTranscription1.0'
This was called using the following line in the 'On Stop' setting on the Mic in the Power App.
Set(TempRecordingVar,MicrophoneQ1.Audio);Set(TempJason,JSON(MicrophoneQ1.Audio,JSONFormat.IncludeBinaryData));Set(StringB64Var,Mid(TempJason,25,Len(TempJason)-25));Set(flowResonseQ1, 'AzureTextTranscription1.0'.Run(Q1UserDetails,", ",StringB64Var));Take the feed from Power Apps
Convert the audio content
Compose
{
"$content-type": "multipart/form-data",
"$multipart": [
{
"headers": {
"Content-Disposition": "form-data; name=\"file\"; filename=\".mp3\""
},
"body": {
"$Content-type": "audio/webm",
"$content":
}
}
]
}HTTP Action (I've removed my key from this image)
Parse the response
{"type": "object","properties": {"text": {"type": "string"}}}Respond back to the Power App with the Azure Open AI Whisper resultsIt works great on browsers, but still a few issues on making it work through ther the Power Apps app on my Android phone. Works fine on the browsers on the phone though. Weird!!!!
That will be later though. I think it is to do with how phones store audio.
- ymutoJun 14, 2024Microsoft
Hello Richard_Wray
Microphone control output format for mobile is different and depends upon device used. For Canvas App Microphone control, the audio formats are 3gp for Android, AAC for iOS, webm for web browsers.
Microphone control in Power Apps - Power Apps | Microsoft Learn
You could use connector to convert audio file type like a CloudConvert - https://learn.microsoft.com/en-us/connectors/cloudconvert/