roundware / roundware-web-template

roundware-web-template.vercel.app
1 stars 4 forks source link

Submitted wav files don't play back. #8

Closed gavspav closed 1 year ago

gavspav commented 2 years ago

I uploaded a wav file and it does not play back in the browser. In the js console I get the following error: 20221011-100318-784.wav:1 Failed to load resource: the server responded with a status of 404 (Not Found) The admin lists the filename as: [20221011-100318-784.mp3]

So it looks like the file is being converted but the file extension is not being changed in the web app?

I've commented out .wav in the permitted files for now.

shreyas-jadhav commented 2 years ago

@hburgund i think this could also be a server change? the url that is populated should already be mp3 i guess. i can use the cleanAudioUrl function in web app if you want. but this would also need to be done in admin.

gavspav commented 1 year ago

If you upload a wav file, it seems to do some background converting to mp3. If I log in to the old admin panel I can see the asset and play it. In the new admin panel I can see the asset but it doesn't load the audio. It gets stuck on Loading Audio 0%. I'm not sure if this is the same bug.

When you try to play back the file, it tries to playback filename.wav - which doesn't exist on the server - instead of filename.mp3 - which does.

hburgund commented 1 year ago

Since Roundware doesn't use wav files anymore, if a wav file is uploaded, it converts it to mp3 and deletes the wav version to save space. So I think the issue is that the server still records filenames in the database with the original uploaded extension rather than the stored extension and the app and admin use this filename for display and playback.

I will investigate the server-side, but @shreyas-jadhav perhaps it is a good idea to have the app and admin parse and replace any file extensions that aren't mp3 just to handle potential bad data?

shreyas-jadhav commented 1 year ago

OK, i added to replace the extension to mp3.

hburgund commented 1 year ago

This is working for me, but @gavspav if you could test too as the OP to confirm, that would be great.

@shreyas-jadhav can you issue a rolling PR from your main so that the newest code can be grabbed from this repo?

gavspav commented 1 year ago

Yeah again, seems to work. Hurrah. Good work!

hburgund commented 1 year ago

fantastic...closing out!