EXT‐MusicPlayer - bugsounet/MMM-Bugsounet GitHub Wiki

This module will play any music found on a USB Key or in defined local folder

This module is a plugin for MMM-Bugsounet

This module need EXT-VLCServer plugin for playing your media

Installation

Execute npm run setup:EXT-MusicPlayer in the MMM-Bugsounet's folder.

cd ~/MagicMirror/modules/MMM-Bugsounet
npm run setup:EXT-MusicPlayer

Configuration

To display the module insert it in the config.js file.

{
  module: 'MMM-Bugsounet/EXTs/EXT-MusicPlayer',
  animateIn: "flipInX",
  animateOut: "flipOutX",
  position: 'top_left',
  config: {
    debug: false,
    useUSB: false,
    musicPath: "/home/pi/Music",
    checkSubDirectory: false,
    random: false,
    autoStart: false,
    minVolume: 30,
    maxVolume: 100,
    loop: false
  }
},

Details

field description type default value
debug Enable debug mode or not BOOLEAN false
useUSB If you prefer play file from an USB Key, set it to true BOOLEAN false
musicPath Music path for playing music from Local Files STRING "/home/pi/Music"
checkSubDirectory Should this module inspect sub directory for create music list ? BOOLEAN true
random Play music in random false
autoStart AutoStart USB key Music at boot of MagicMirror or when USB key is plugged in BOOLEAN false
minVolume Volume to set when assistant speaking NUMBER 30
maxVolume Volume to set when music playing NUMBER 100
loop  Restart playlist when done  BOOLEAN false

Notes:

  • Volume is in %
  • Volume is used only with MMM-Bugsounet

EXT-TelegramBot Commands:

You can control EXT-MusicPlayer with EXT-TelegramBot

The main command is /music

  • /music play: Launch music (last title)
  • /music pause: Pause music
  • /music stop: Stop music
  • /music next: Next track
  • /music previous: Previous track
  • /music rebuild: Rebuild music Database
  • /music volume: Volume control, it need a value 0-100
  • /music switch: Switch between USB Key and Local Folder
  • /music random: Switch between random playing (toggle)

** In random playing mode: previous not working properly **

Developer Notes

Incoming notification:

  • Bugsounet_MUSIC-PLAY: Start playing music
  • Bugsounet_MUSIC-STOP: Stop music
  • Bugsounet_MUSIC-PAUSE: Pause music
  • Bugsounet_MUSIC-NEXT: Next track
  • Bugsounet_MUSIC-PREVIOUS: Previous track
  • Bugsounet_MUSIC-REBUILD: Rebuild music Database
  • Bugsounet_MUSIC-SWITCH: Rebuild music Database
  • Bugsounet_MUSIC-VOLUME_MIN: Set volume to min (see config)
  • Bugsounet_MUSIC-VOLUME_MAX: Sest volume to max (see config)
  • Bugsounet_MUSIC-VOLUME_SET: Volume control with payload [0-100]

Outgoing notification:

  • Bugsounet_MUSIC-CONNECTED: When a music is playing
  • Bugsounet_MUSIC-DISCONNECTED: When music player is in rest

User Notes

What can music module can play ?

Music module can play this format:

  • mp3
  • flac
  • wav
  • ogg
  • opus
  • m4a

Visual

  • If a cover was found inside your music file, this module will descrypt it and display it
  • It will display all informations from the file