This project aims for simulate some feature of streaming in Spotify app: stream music with http byte-range request.
The project uses Svelte for the frontend and Golang for backend:
- Transcode audio using Ffmpeg command, use library libfdk_aac for higher quality encoder.
- Use Mp4dash to fragment the file into byte-range within the mp4 container.
- Then in the frontend, fetch chunks of audio data in byte-range specified at the request headers.
Credit inspiration to this github repo.
Clone this project
cd backend
go run cmd/api/main.go
cd frontend
npm install
npm run dev
The demo looks like this Notes TODO: seeking audio feature can becomes buggy and might not work properly.