Can't play audio file in assets folder #8961
Answered
by
rstoenescu
ghosteye1
asked this question in
General - Components / Directives / etc
-
Small mp3 file exists on my assets/sounds folder. I tried following but getting 404 for that. const audio = new Audio('~assets/sounds/swiftly-610.mp3') |
Beta Was this translation helpful? Give feedback.
Answered by
rstoenescu
Apr 19, 2021
Replies: 1 comment 2 replies
-
You're literally trying to access
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
rstoenescu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're literally trying to access
/~assets/sounds/swiftly-610.mp3
. There's no one to parse and interpret the requested URL, as in the SFC template. So two options: use the /public folder OR: