<audio> tag not building mp3 to dist/assets #12082
Replies: 3 comments
-
@hidden1nin The link you provided cannot be opened. For audio resource files, it is recommended to put them in the public directory. |
Beta Was this translation helpful? Give feedback.
-
@hidden1nin @chenxch I stumbled upon y'all while having a problem of my own with an audio tag i was trying to play as looped background music in my website. I also found that the convention is to place the audio in the public folder for the build process. What actually worked for me in the end was placing it in /src/assets, but it's noteworthy that I was then using that audio not in an html file but in a .tsx file so I imported it and then it worked. My understanding is that:
Again the link in the question doesnt work, and i am years late here, but still though if i was stuck for a few hours maybe I'd contribute to the only discussion i found relevant. |
Beta Was this translation helpful? Give feedback.
-
@hidden1nin & @chenxch I stumbled upon y'all while having a problem of my own with an audio tag I was trying to play as looped background music on my website. I also found that the convention is to place the audio in the public folder for the build process. What actually worked for me in the end was placing it in /src/assets, but it's noteworthy that I was then using that audio not in an HTML file but in a .tsx file so I imported it and then it worked. My understanding is that:
Again, the link in the question doesn't work, and I am years late here, but still, though if I was stuck for a few hours maybe I'd contribute to the only discussion I found relevant. |
Beta Was this translation helpful? Give feedback.
-
I'm having issues getting tag to work, if I use source or video then the files are moved and the src is changed correctly in the elements. I think it might be due to this right here.
https://github.com/vitejs/vite/blob/128f09eb0100e80f566e33ca8c55bcd0896d4e38/packages/vite/src/node/plugins/html.ts#L132 might hold some solution
Beta Was this translation helpful? Give feedback.
All reactions