GoFM

A cross-platform real-time audio streaming server for MP3 files, written in Go. It allows synchronized playback across multiple clients.

Go v1.16 Go Report Card Downloads License References Forks Stars

fm.stackstore.net

What is GoFM?

GoFM is a cross-platform, real-time audio streaming server written in Go. It enables you to stream MP3 audio files from a specified directory over HTTP and synchronize playback across multiple clients.

We have fully opened the source code of GoFM under the MIT license. See the project on GitHub: https://github.com/stack-store/go-fm.

Getting GoFM

We recommend downloading the precompiled GoFM from GitHub Releases. If you prefer, you can compile from source.

Project link: https://github.com/stack-store/go-fm

Configuring the Directory

Create a folder named fm and place the GoFM executable in it. Then create a music folder inside fm and copy your MP3 files there. Example structure:

fm
├─ GoFM    # or GoFM.exe on Windows
└─ music
   ├─ Style.mp3
   └─ Yesterday.mp3

Starting the Service

Open a console, cd to the fm directory and run:

# linux / mac
./GoFM -d ./music

# windows
./GoFM.exe -d ./music

If you see http server started on [::]:8090 in the console, the service is running. Visit http://127.0.0.1:8090 to verify.

🎉 Congratulations — your first GoFM service is running.

You can set the service name and port with -n and -p:

# linux / mac
./GoFM -d ./music -n "Taylor's Music" -p 8080

# windows
./GoFM.exe -d ./music -n "Taylor's Music" -p 8080

Visit http://127.0.0.1:8080 after starting with the new port.

To list all supported flags run:

# linux / mac
./GoFM -h

# windows
./GoFM.exe -h
Usage: GoFM [options]
  -d string
    directory to play (default "./")
  -debug
    enable debug mode for server
  -h    show help information
  -host string
    server host address (default "0.0.0.0")
  -n string
    server name (default "GoFM")
  -p int
    server port number (default 8090)
  -r    enable random playback mode