Upload webm as mp3

Options
Yohami
Yohami Member Posts: 2
edited May 23 in Developer APIs

We're making a chat application in Flutter that features voice recording. On the web client, the files are encoded as webm and those are not supported for playback on iOS.

I guess I can use the transformation tools to re encode the webm to mp3 on download - but this is probably not optimal, is there a way to automatically convert the webm to mp3 on upload?

Answers

  • atdatu
    atdatu Member, Cloudinary Staff Posts: 11
    Options

    Hi Yohami,

    Thank you for reaching out! The easiest way to convert on upload is to create an upload preset where a format can be defined such as mp3 and this will be the converted format before the asset is saved in Cloudinary.

    Follow the steps here on how to create an upload preset: https://cloudinary.com/documentation/upload_presets#creating_and_managing_upload_presets

    Once that upload preset is created, then use that upload preset during upload: https://cloudinary.com/documentation/image_upload_api_reference#upload

    Let us know if you need further assistance.

  • Yohami
    Yohami Member Posts: 2
    Options

    Thanks, I made it work with unsigned uploads. How do I pass the preset for signed uploads? I guess inside of optParams?

    optParams : { "uploadPreset" : "myPreset" }

    ?

  • victor_cloudinary
    victor_cloudinary Member, Cloudinary Staff Posts: 10
    Options

    Hi there,

    An upload preset is required for unsigned uploading, and optional for signed uploading, therefore it should work the same way. You can see more about the upload API method here: https://cloudinary.com/documentation/image_upload_api_reference#upload

    If you encounter any issues with this, please feel free to create a support ticket at support.cloudinary.com and paste the code you're using, and let us know what is the cloud name for your account so that we can investigate it for you!

    Regards,
    Victor