首页 > 解决方案 > Is it possible to get a direct audio file link from Soundcloud without JS

问题描述

I've seen many posts about using JS to embed SoundCloud tracks with API links, but I'm wondering if there is any possible way to use only the <audio> and a SoundCloud file link in HTML?

The reason I need this is because I'm using Google Sheets as a widget for my website to display a list of audio files from different sources and using other sites and getting the mp3 link and throwing it in the list for the template works well but I can't do that with SoundCloud.

Preview of widget here

I know this is the URL I need:

http://api.soundcloud.com/tracks/TRACKID/stream?client_id=CLIENTID

I've tried inspecting the web page for this information, and it's not provided. I can only get the track ID.

My google sheet's template is connected to an app called awesome-table so I can put down a long list of data without needing to manually write the HTML each time so I need to make it a uniform process.

Each cell is referred to as {{URL}} in the following example

<audio controls> <source src="{{URL}}" type="audio/mpeg"> </audio>

The additional details, such as the third-party applications, are just to explain why I'm doing it this way. The question is simply how to get the right data of a Soundcloud track in a way I can directly apply <audio controls> <source src="(soundcloud track here)" type="audio/mpeg"> </audio>

标签: htmlhtml5-audiosoundcloud

解决方案


目前,这样做的唯一方法是,如果作者为曲目启用了 RSS 提要,并在音频源中使用该 RSS URL。

http://feeds.soundcloud.com/stream/example.mp3


推荐阅读