Problem related to audio embedding | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Problem related to audio embedding

plz help me.... <audio controls> <source src="path of audio file\filename.mp3" type="audio/mp3"/> </audio> as here path of file IN MY PC is C:\Users\saurabh rajput\Music\favourite\audios ,yeah no problem it works well in my pc. i can play song by clicking on play button. But outside of my pc if i paste this code it doesn't work bcz the reason is path of file which matches only with my pc. my problem is what should i do to share my code embedded with my songs in my pc which should work in all devices...? Is there any solution to this problem..... plz help me plzzzzz............ Here i attached my pc code with this problem.... check it out and give me best solution.. https://code.sololearn.com/WOl690vDj0n4

20th Aug 2020, 8:56 AM
saurabh
saurabh - avatar
2 Answers
+ 1
Keep audio file in your project folder and use relative path. Or you can use online storage such as Dropbox , but it'll not be available offline to work with. https://code.sololearn.com/WW6t4B73kJVz/?ref=app
20th Aug 2020, 9:00 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 1
You can upload your audio file to any cloud platform and generate the link path and use it easily. But the cloud platform must be in public not private. Inside the pc you can get the link destination easily so you faced not problem loading your audio files but outside of your pc the audio destination must be changed. If you upload your file to a server then your destination will be in the server htdocs/www folder. Then you should upload the mp3 file to the same root path for get the link. The link is important but be assure that your destination is right.
20th Aug 2020, 9:12 AM
Bits!