Hey all I have a web app where users can upload audio files like mp3’s, wavs and m4a’s.
I’m simply using the default html audio player to render the audio.
A while back I started noticing that a sporadic few of the audio players were greyed out.
I went into my supabase backend to open the actual audio file and found that I was able to play the audio file
when I downloaded it to my PC.
Upon reading this thread (Why is this specific m4a audio file not playing on the <audio> component, but any other one will?)
it looks like the issue is the codec with some .m4a files.
Some m4a files are using the AAC (widely supported) codec and some are not.
Currently I have JS code that
- grabs the file blob
- checks if the upload name contains mp3, wav or m4a
- uploads the blob to supabase
in between 2 and 3 I’d like to check that the codec of the blob is AAC and if possible change the codec (??)
I’ve asked CGPT for a solution but it point sme to FFMPEG and from reading the docs it looks like FFMPEG core is about 30MB to load…
(https://ffmpegwasm.netlify.app/docs/getting-started/usage/)
This seems like a lot to me – granted most of the app will have already been loaded by the time a user gets to this flow.
I just wanted to reach out and see if anyone has figured out a better solution