0
adding music from hard drive
how would one add music from their hard drive to html to place on a website or else where for that matter?
4 Réponses
+ 1
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
http://www.w3schools.com/tags/tag_audio.asp
0
C:\Users\losts\Desktop\Pink Floyd - Discovery [Complete Studio Recordings][16-CD Box Set][FLAC] (2011)\1971 - Meddle\01 - One of These Days.flac
how would i add that for example
0
You can add by two ways.
1. Absolute path : "C:/~Folder/~filename" This is the complete path of the file you want to include.
2. Relative path : './~filename' or '../~filename' Notice the dot. Its relative path. Browser searches for the file within the .htm file stored directory for '.' (current folder) and its parent directory for '..' (parent folder)
Example would look like this.
<audio controls>
<source src="./horse.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
0
see Patrick irby & anyone reading this if you want to add a song may be that song one of these days then first select that song and right click on it then go to properties then go to security and copy the object name of the song the name will be copied along with the path so next thing you have to do is just paste that name into your code
For Example : I am showing you how i added a audio element using a file which i already have in my pc
<audio controls>
<source src="C:\Users\admin\Documents\HTML Programs\Aaja_Shaam_Hone_Aayi-Sitar ringtone.mp3" type="audio/mpeg">
<source src="C:\Users\admin\Documents\HTML Programs\Aaja_Shaam_Hone_Aayi-Sitar ringtone.ogg" type="audio/ogg">
</audio>
in your case just the path will be different like C:\Users\losts\Desktop\Pink Floyd
and so on....