MusicShare.Me

What is MusicShare? Well, it is a text service that will allow anyone in any location to search/play/skip and much more via SMS. Currently works with Deezer and Spotify.

Technology Used:

  1. Bose SoundTouch API - API used for controlling Bose Wi-Fi/SoundTouch enabled devices (Example of Devices)

  2. Music Content Providers • Spotfiy APIDeezer APIMusixMatch API

  3. NGROK - Software used to tunnel Bose speaker's personal localhost to a public IP

  4. Flask - A microframework for Python used as our server side "Command Center" to routing and managing sms messages.

  5. Twilio - API SMS service used to send text messages to our Python server

Phone Number Current Number: (754-800-BOSE)


The Process

Step 1: Bose SoundTouch API/Media Cotent API

  • Research API structure
  • Find/Test all commands below

Step 2: NGROK

  • Create tunnel path from localhost "Bose Speaker" to Public Live IP Address

Step 3: Server Side (Flask)

  • Convert Twilio "text messages" to readable APIq calls for Bose Speaker
  • Command Center ~ Controlling user's texts message in a queuing sort method

Step 4: Twilio

  • Allow users to send SMS to phone number in order to relay message to Server side.

API Documentation


Instructions to get Bose speaker onto Wi-Fi network:

  1. Simultaneously press Preset 2 & Vol - for 5 seconds until the countdown is complete and the wifi LED is orange
  2. On your computer, phone or tablet, connect to the BOSE Soundtouch...
  3. Open a browser and go to 192.168.1.1 and follow the instructions

After successful connection, the wifi LED on device should be white.

To get the IP:

  1. Simultaneously press Preset 5 & Vol - for 5 seconds
  2. Use the Vol-/+ keys to scroll through the content until you see the IP Address

How to Run:

  1. Download/Clone Repo via GitHub Here!
  2. Installing Dependencies > pip install Flask Missing Pip, go Here!
  3. Go to Twilio Site, see below section How to setup Twilio
  4. Run ngrok.exe in root
  5. Within ngrok run command ngrok.exe http 5000 > This will make the "tunnel" between Twilio and your Python Server. Keep running!
  6. Copy the Forwarding Address (Ex: http://941f0664.ngrok.io) This will be used for Step 8 in the section below.
  7. Edit the file, CONFIG.ini Change speakerAddress under [config_searchandplay] to the address from your Bose speaker itself in the steps above. Do the same for the webViewAddress in the same file. The value for webViewAddress comes from ngrok.exe under Web Interface.
  8. Within Repo open a command line (Run as Admin)
  9. In CMD run command python server.py

Done!

Easy Method: Virtualenv (Linux)

  1. Install virtualenv, either sudo apt-get install python-virtualenv or sudo pip install virtualenv
  2. Run virtualenv with Python 3.X interpreter, virtualenv -p python3 envname Change envname to whatever you like, we will use modules
  3. Now activate virtualenv, source modules/bin/activate && python -V
  4. Now for the python modules Twilio and Flasks
  5. Twilio, easy_install Twilio
  6. Flask, easy_install Flask
  7. Finally run, python server.py

Okay, now it is really done!


How to setup Twilio :

  1. Create an Account
  2. Create a Number # (With Capabilities set to ANY)
  3. Now go to Account Settings (Upper Right Corner)
  4. Copy your AccountSID (Ex: ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) and replace the value account_sid in the file CONFIG.ini
  5. Copy your AuthToken (Ex: 5eXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) and replace the value auth_token in CONFIG.ini
  6. Finally for configuring variables, change from_ in CONFIG.ini to your Twilio number.
  7. On the Twilio Site, go to Numbers (Main Black bar on Twilio site)
  8. Click your # > Scroll Down to SMS & MMS
  9. Replace Request URL with your NGROK value (Ex: http://941f0664.ngrok.io)

Commands:

Note: Keyword is an interchangeable variable stored in the CONFIG.INI file. This is used to distinguish commands from text/values. Default keyword is B

⦿ Play a Song, the best method is to provide the Song Title & Artist. You can send in a just the song title but chances of another song sharing the same title is high. However, sending just the artist will provide a complete playlist of songs from that artist.

Format: <Keyword><Source> <Song Title> by <Artist>

⦿ To Use Deezer: BDeezer Call Me A Spaceman by Hardwell

⦿ To Use Spotify: BSpotify Lose Yourself by

⦿ Volume, controls the speakers volumes with an integer from 0-100. BVolume 20or BVolume Upor BVolume Down


Special Playlists

Top Playlist , is an organic playlist that will grow as you continue to use MusicShare. This is done by registering the top 10 songs based on the how often played and highest thumbs up. These top 10 songs will then be stored in a special playlist. So if you or your friends can not figure out a song to play, you can simply play this playlist and instantly have everyone's favorite song playing. BTop - Adds this playlist to the current queue BTopClear - Clears the current queue then adds this playlist.

Genre Playlist , is a playlist that will be generated using a genre type (Rock, Jazz, and etc). This playlist can be as large as you like.

Format: <Keyword><Source> <Genre Type> <# of songs>

BDeezer Genre Rap 10


Voting System

⦿ Like, Allows users to vote on repeating a song using the input of the majority (50% over). BLike

⦿ Boo, Allows users to vote on skipping a song using the input of the majority (50% over). BBoo


Buttons

⦿ BPower, Allows user to turn the speaker on/off. BPower On or BPower Off

⦿ Select Preset(s), Allows users to quickly access preset streaming music platforms, playlists, or etc. There are six total presets stored on the Bose speaker. BInput Preset 1, BInput Preset 2, and etc.

⦿ Select AUX, Allows users to select AUX input. BInput AUX


System Settings

⦿ Access Developer Settings, such as IP/Mac Adress, volume, base settings, and etc BSystem

⦿ Basic System Settings, includes volume level, bass level, current song. BStatus


*Note: *Admin_Mode is an interchangeable variable stored in the CONFIG.INI file. This is used to enable or disable the following commands. Default Admin_Mode is True. As a follow up in security, the first number to SMS the speaker will become the solo admin for that instance.

Admin Use Only

⦿ Skip current song completely. BSkip

⦿ Clear everything and bring the speaker and server back to a new state.j BClear

Built With

Share this project:

Updates