'how to upload mp3 files to github and play them from a webbrowser
I created a repository and then I uploaded audio files into it. When I go to the audio files, for example: https://github.com/cre8ture/audioFilesForBL/blob/main/1.mp3
It goes to the github page, rather than playing the audio file directly.
My ultimate aim is to upload a few audio files so that a website using React can play the audio file
for instance I'd like to load
const audioTune = new Audio("https://github.com/cre8ture/audioFilesForBL/blob/main/1.mp3");
and play that file.
Thank you
Solution 1:[1]
I"m sure you already figured it out but append the url with "?raw=true" and it should run.
so like: "https://github.com/cre8ture/audioFilesForBL/blob/main/1.mp3?raw=true"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Arthur Lee |
