i am collaborating with another repl.it user and i am wondering how you would get a audio file to play in the index.html.
where would i have to go and what would i code to get the audio to play?
so this python code will work in HTML? @RYANTADIPARTHI
@dominicl645 uhh, no. If you are doing this in HTML, do it this way:
<audio controls>
<source src="Your file name">
</audio
And for the file name, do the same thing, for the HTML, just click on three dots, and all.
To get an audio file you simply need to use an <audio> tag. In side the tag you can give it a "src" attribute with the url of the audio!
<audio src="url">
You can also add a "controls" attribute after "src"
<audio src="url" controls>
how would i use that code on a mp3 file already uploaded into the replit? @RedPandaCode
@dominicl645 Hmmm... I haven't done that before. Perhaps in "src" you may need to use the file name in repl rather than the URL
<audio src="filename.mp3" controls>
ok i'll try it. @RedPandaCode
@dominicl645 Hopefully it works!
hopefully. @RedPandaCode
ok it wont play. @RedPandaCode
@dominicl645 This is what an audio should look like. See if it helps.
(Also make sure that your volume is turned up)
If this does not appear your code may be wrong somehow.
(This was made using the "controls" attribute)
Since you uploaded the file into repl, if nothing else works, try swapping the "src" attribute for an "href" attribute
<audio href="filename" controls>
If you're trying to do in (X)HTML, then everyone's already answered you.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
If you wanted to start it from JavaScript, MDN has documentation on it:
anyone know how to do this? pls help me