Skip to content

BunFM

BunFM is a real-time audio streaming service built with Node.js, enabling synchronized playback across multiple clients and controllable via Telegram Bot.

Node.js >=20Bun >=1.1.0DownloadsLicenseForksStars

bunfm.stackstore.net

Features ✨

  • 🎵 Synchronized Playback: Sub-100ms latency between clients
  • 🤖 Telegram Integration: Full control via chat commands
  • 📤 Multi-source Upload: Support audio/voice messages
  • ⏭️ Queue Management: Skip/remove tracks, shuffle mode
  • 🔄 Transcoding: Universal format support via FFmpeg

Installation 🛠️

Requirements

  • Node.js v20.14+ & Bun runtime
  • FFmpeg v6.0+ (brew install ffmpeg or apt-get install ffmpeg or winget install ffmpeg)
  • Telegram Bot Token (create via @BotFather)

Quick Start

bash
git clone https://github.com/pxgo/bun-fm.git
cd bun-fm

# Configure environment (minimum setup)
echo "BUN_FM_BOT_TOKEN=YOUR_TELEGRAM_TOKEN" > .env

npm install && npm run build
npm start

Access stream via:
ffplay http://127.0.0.1:7080
or browser: http://127.0.0.1:7080

Configuration ⚙️

Environment Variables

Environment VariablesDescriptionDefault
BUN_FM_HOSTBinding host address127.0.0.1
BUN_FM_PORTHTTP service port7080
BUN_FM_BOT_TOKENTelegram Bot Token(required)
BUN_FM_TMP_DIRTemporary file storage./tmp
BUN_FM_AUDIO_DIRPersistent audio storage./media
BUN_FM_RANDOMEnable random playbacktrue
BUN_FM_DOMAINPublic domainhttp://[host]:[port]
BUN_FM_BUFFER_SIZEAudio buffer size100KB
BUN_FM_AUTO_REMOVEEnable automatic deletion of played filesfalse

Telegram Bot Integration

  1. Start interacting: /start
  2. Upload audio files directly to chat (supports both audio files and voice messages)
  3. Control commands:
CommandDescriptionExample
/startShow system status/start
/lsList available tracks/ls
/rm <index>Remove track by number/rm 3
/muteToggle mute/unmute/mute
/nextSkip to next track/next

License 📜

MIT License