Skip to content

BarakBinyamin/mic

Repository files navigation

mic 🎤📼🛼📺🎞️🕹️👾☎️🎸💿💾

A voice controllable internet radio station

Developers

Requirements

Quickstart

# Get this project
git clone https://github.com/BarakBinyamin/mic.git
cd mic

# Launch the radio and database on ports 80 & 7700
platform=`bash platform.sh`
PLATFORM="${platform}" docker compose up -d 

# Add and play "This Love" by Marroon 5
bash demo.sh "This Love by Marroon 5"
# Test exposing to the internet with localhost.run
ssh -R 80:localhost:80 nokey@localhost.run

The radio should be running @ localhost:80 and the link provided by localhost.run

Control the radio using siri shortcuts or using curl & the API

Project Directory

Name Purpose
backend Most of the functionality behind this project
library Where media lives
shortcuts Siri shortcuts for the radio
view Where the UI is developed
demo.sh The demo script
dockerfile Docker container setup file
docker-compose.yml Manages multiple docker containers

API

  • /api/add?song=whatever, trys to find the song and download it to your library from youtube
  • /api/play?song=whatever, skips whatever the current song is and plays yours
  • /api/queue?song=whatever, adds song to the queue
  • /api/skip, skips the current song
  • /api/queuelist, shows the queue in json format

Docker

If you want to use docker instead of docker compose...

# Launch an elastic search database, also exposes a debugging website @ http://localhost:7700
docker network create test-network
docker run --name meili --network test-network -p 7700:7700 -v $PWD/library/meili:/meili_data -d -it getmeili/meilisearch:v1.0.2

# Build and run the radio, for a ctrl-c'able mode, switch the -d with -it --init
docker build --tag radio .
docker run -p 80:80 -v ${PWD}/library:/usr/src/library --network test-network -d radio --port 80

Technologies

Features and Bugs

Coming soon

  • Synchronized library and meilisearch on startup
  • Docker Compose to simplify startup
  • Seperate concerns where possible
  • More api docs
  • Radio controls UI, with voice over
  • Visuals for the audio
  • Message to let poeple know when song is buffering
  • Up next on the bottom of the main page
  • Click here to see a video demo

Known bugs

  • Fix the ratio of mp3 bytes to seconds to prevent stalls
  • Handle unlisted youtube videos when auto adding songs
  • Colorize text based on background
  • Radio sometimes crashes on boot with an error about not being able to find a file

Motivation

I enjoy listenting to music, and I wanted to share what I was listening to with my friends and family

This project was also a great opportunity to develop an application that was:

  • 🐳Containerized
  • Muti-Paradigm
  • Blazing Fast
  • 🥪Full Stack

References