cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Upload audio files in powerapps

Hello,

 

I have created an API to upload audio/ image files in BLOB storage using the article https://powerapps.microsoft.com/en-us/blog/custom-api-for-image-upload/

 

I am able to upload audio as well as image files directly through this API. However, when I add the Custom API connection in my app and pass the audio file as param, it gives invalid argument error. The same code works for image type. Below is the sample code.

 

Capturing Audio:

Collect(Statements,{Recordings:MyMicrophone.Audio})

 

API call to uplload audio

ForAll(Statements,Collect(MediaURLs,MediaUploadAPI.UploadMediaFile(Recordings).FileURL));

 

Let me know how can I achieve uploading audio files to AzureBlobStorage.

 

Thanks Vaishali

3 REPLIES 3
Highlighted
Power Apps
Power Apps

Re: Upload audio files in powerapps

Hi Vaishali, Sorry for the delay, you can use the similar API code for uploading Audio files (from the Microphone control). There is only one small change you need to implement for using the API with audio files vs image files.

 

In the AddFileParamTypes.cs file, replace the following line :

vendorExtensions = new Dictionary<string, object> { {"x-ms-media-kind", "image" } }

with this line instead :

vendorExtensions = new Dictionary<string, object> { {"x-ms-media-kind", "audio" } }

 

Do let me know if the solution works for you.

Pratap Ladhani,
Customer & Partner Success PM
Microsoft PowerApps and Microsoft Flow
Highlighted
Regular Visitor

Re: Upload audio files in powerapps

Please can I ask if you got this to work? I've been attempting the same thing. Similarly, my API will upload audio just fine via the Swagger UI. However, having modified the "vendorExtensions = new Dictionary<string, object> { {"x-ms-media-kind", "audio" } }" line per Pratap's post, calling the API in PowerApps and trying to pass audio from MyMicrophone.Audio is being seen as invalid.


Would be great if you had any tips.

 

Thank you!

Highlighted
New Member

Re: Upload audio files in powerapps

Any solution for this case? I traying too an upload of audio files to blob storage but without success, i give a "An error ocurred" as a response.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,984)