我可以 link 非本地音频进入我的 html 文件吗?

Can I link audio thats not local into my html file?

我的主机不允许我上传 mp3 或任何音频文件,那么我有什么办法可以 link 以其他方式播放音频吗?我知道我们可以嵌入 soundcloud 之类的东西,但只是想知道是否还有其他选择。

我发现这非常有用 guide 涵盖了一些替代方案:

Linking to a sound file using a href allows a browser to open and play an audio file if the viewer of your web page has properly configured their Internet browser. You can also use the tag or the newer tag to insert a sound file directly into a web page.

<a href> 标签

<a href="https://www.computerhope.com/jargon/m/example.mp3">Play sound 
file</a>

<audio> 标签

该标签可以创建一个媒体播放器作为网页的一部分。它允许访问者播放、停止、暂停或下载音频文件。该元素与所有现代网络浏览器兼容。

<audio controls>
  <source src="https://www.computerhope.com/jargon/m/example.mp3" />
</audio>

<embed> 标签

一种包含音频文件的旧方法是使用标签。虽然这种方法确实有效,但它的效率不如上面提到的那些。因此,我们建议使用上述解决方案之一。

<embed src="https://www.computerhope.com/jargon/m/example.mp3">

我想出了不上传您的 audio/music、BASE64 编码的最佳方法!!

非常简单,有点乱,我猜应该用于图像,但适用于音频,也适用于视频(还没有尝试过视频)

这里是一个base64编码器:https://omatsuri.app/b64-encoding

虽然警告!它可能会变得迟缓和凌乱