Audio Problem VSCode
Hi everyone, so I am currently learning CSS HTML and especially Java Script, and I made some sort of Music Player, by coding it from someone. Now I tried to add my Mp3 Files, and it says "An error occurred while loading the audio file". After I downloaded the guy that made the Player and inserting them, they work. Does anyone know how to fix it?
23 Replies
this really doesn't sound like a VSCode problem. Are you having this issue in your browser? If so, please read #how-to-ask-good-questions then make a new post in #front-end that shares your code
what do you mean in my browser? No If I drag and drop my own audio files into vs code, opens up a window IN vs code that says "error while loading the audio file". If I use one of the person that made the original player and do the same thing, they load
I'm not sure why you'd want to play an audio file in vscode?
seems like it supports mp3 files, what type of audio file are you dragging on there?
.mp3
so It should work
As i mentioned, it is supposed to be a small audio player where I can put some audio files
wait I can send screenshot
This is what it looks like If I drag one of the authors files
this si what it looks like with one of mine
both are .mp3
does yours play in another player?
Yep
both do
I'm still not sure why you want it to work when you drag it onto VS Code though
like, what does that accomplish?
For the music player, I refer to the folder assets and pull the mp3 files in numerical order
but it doesnt load in vs code
and thus it doesnt play with my music player
but VS Code isn't involved in playing the file when you open your project in your browser
no but it also doesnt play in my browser
how did you make the mp3 file?
downloaded it
in the live preview addon mine againt dont play and his do, as well in the browser
can you legally link to it?
YT premium
and then converted it
and obv renamed
did you change the extension?
no
it downlaoded as mp3
with that I mean renamed and moved it to my folder, so converted it to a theoretically functional file for the vs code
ah whatever I give up
thx for ur help
if you downloaded it from youtube, it might have drm on it or something, that's the only thing I can think of
wait Ill try using my python script to download it
that might work
well alr, kinda worked
in the browser it plays now
but not in vs code and that live preview addon
sounds like a codec issue maybe, hard to tell without the file. But you may want to use live server instead of the preview in vscode https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer
that way you can test in your browser, which is after all where you'll be using your code
Ok thx
it works okay now
Ill use that now