cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Richard2
Level: Power Up

Re: saving microphone audio

Can you please tell me how to send the audio file to your e-mailbox?

 

When i use Microsoft Flows and the code below i get an error:

Speech_test.run(Microphone1.Audio)

 

Highlighted
mpjjonker
Level: Powered On

Re: saving microphone audio

 

 

 

I recreated the PowerApp and a new Flow. In the flow , in the attachment (advanced options) of the e-mail action step, select "Ask In PowerApps:, this creates a new attribute "SendAnEmail_body"

In the PowerApp, in the OnStop of the AudioRecording element, Type VoiceToEmail.run(Microphone1.audio)

When I test this, I get an email with an attachment. The attachmentname must have a value (not in the screenshot)

I hope the screenshots explain the rest.

 

FlowVoiceToEmail.PNGFlow

PowerAppVoiceToEmail.PNGPowerApp

Richard2
Level: Power Up

Re: saving microphone audio

Thanks @mpjjonker!

Mike8
Level 10

Re: saving microphone audio

Hello,

You can also send audio and images by mail, by using the Office 365 Outlook connector and this formula:

Office365.SendEmail(TextInput1.Text,"Test send media","Test",{Attachments:Table({Name:"Audio.mp4", ContentBytes:Microphone1.Audio},

{Name:"Image.jpg", ContentBytes:AddMediaButton1.Media,})})

TextInput1 should have the Email address that you would like to send the email to.

Windows media player didn't open the audio file. VLC did.


Mike8
Level 10

Re: saving microphone audio

Also about saving microphone audio we used a custom API.
It should be defined like this in the swagger file:

"AudioTest":{
"type": "object",
"properties": {
"Audio":{"format":"byte","type":"string"}
}}

By using this we received a Base64 string.
Next step was to send it back to Powerapps. It worked.
We had the string but we couldn't hear the sound though.
The solution is, for some reason that I can't understand, to have the Base64 string inside the Text function.

For example if you receive the string and have it at the first record inside the AudioCollection under the AudioColumn then you should have at the audio control:

Audio1.Media=Text(First(AudioCollection).AudioColumn)

And TANTAN. It works. Also for the other media. Image and peninput.

mpjjonker
Level: Powered On

Re: saving microphone audio

Thanks ! I will try this out and report back.

Mike8
Level 10

Re: saving microphone audio

Hello @mpjjonker,

I did some testing and it doesn't work with audio anymore. I don't know why.
I guess they changed something. I am sorry if I got your hopes up.
It is still working with Images and PenInputs.
Last year, I tested audios and it was working fine. I will update if I have any news.

Anonymous
Not applicable

Re: saving microphone audio

I was able to saving my recording form my PowerApps to a SharePoint list using Flow, however it was in a unplayable formate.

 

Any idea on how I can fix this?

 

I tried the Email method as well but that too did not work.

Mike8
Level 10

Re: saving microphone audio

Hello Joshsolomid,

I haven't tried to save it to a Sharepoint list but I think you should try to add .mp4 as an extension to the filename.
So when you save it, I can see on the attached picture of the flow that you have that you ask for the filename in Powerapps
File Name ---> |Addattachment|.
Can you try to add .mp4 to the filename in flow? File Name ---> |Addattachment|.mp4 

hullie
Level: Powered On

Re: saving microphone audio

You can also save it to a MS SQL database  (varbinary type)

 

Like:

 

Patch(
    '[dbo].[tblMMMemos]',
    Defaults('[dbo].[tblMMMemos]'),
    {
        ID: lblID.Text,
        Contact: "",
        Name: lblCurrentUser.Text,
        AudioClip: MyMic.Audio
    }
);

 

 

Later I play it back from the database using an (classic) asp file:

 

<% 
 response.clear
 response.contenttype = "audio/ogg"
 openConn con
 iID=request("ID")
 Set cmdAudio = Server.CreateObject("ADODB.Command")
 cmdAudio.ActiveConnection=con
 cmdAudio.Prepared = true
 cmdAudio.commandtext="SELECT AudioClip FROM tblMMMemos WHERE ID=?"
 cmdAudio.Parameters.Append cmdAudio.CreateParameter("@ID", adInteger, adParamInput, , iID)
 set rstAudio = cmdAudio.execute
 if not rstAudio.eof then
  response.BinaryWrite(rstAudio("AudioClip"))
 end if
 
 closeconn con
%>
 
 

The URL of this page you can feed to your audio component in Powerapps

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 87 members 5,374 guests
Please welcome our newest community members: