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:
Bose SoundTouch API - API used for controlling Bose Wi-Fi/SoundTouch enabled devices (Example of Devices)
Music Content Providers • Spotfiy API • Deezer API • MusixMatch API
NGROK - Software used to tunnel Bose speaker's personal localhost to a public IP
Flask - A microframework for Python used as our server side "Command Center" to routing and managing sms messages.
Twilio - API SMS service used to send text messages to our Python server
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:
- Simultaneously press
Preset 2&Vol -for 5 seconds until the countdown is complete and the wifi LED is orange - On your computer, phone or tablet, connect to the BOSE Soundtouch...
- 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:
- Simultaneously press Preset 5 & Vol - for 5 seconds
- Use the Vol-/+ keys to scroll through the content until you see the IP Address
How to Run:
- Download/Clone Repo via GitHub Here!
- Installing Dependencies > pip install Flask Missing Pip, go Here!
- Go to Twilio Site, see below section How to setup Twilio
- Run ngrok.exe in root
- Within ngrok run command
ngrok.exe http 5000> This will make the "tunnel" between Twilio and your Python Server. Keep running! - Copy the Forwarding Address (Ex: http://941f0664.ngrok.io) This will be used for Step 8 in the section below.
- Edit the file, CONFIG.ini
Change
speakerAddressunder[config_searchandplay]to the address from your Bose speaker itself in the steps above. Do the same for thewebViewAddressin the same file. The value forwebViewAddresscomes from ngrok.exe under Web Interface. - Within Repo open a command line (Run as Admin)
- In CMD run command
python server.py
Done!
Easy Method: Virtualenv (Linux)
- Install virtualenv, either
sudo apt-get install python-virtualenvorsudo pip install virtualenv - Run virtualenv with Python 3.X interpreter,
virtualenv -p python3 envnameChange envname to whatever you like, we will usemodules - Now activate virtualenv,
source modules/bin/activate && python -V - Now for the python modules Twilio and Flasks
- Twilio,
easy_install Twilio - Flask,
easy_install Flask - Finally run, python server.py
Okay, now it is really done!
How to setup Twilio :
- Create an Account
- Create a Number # (With Capabilities set to ANY)
- Now go to Account Settings (Upper Right Corner)
- Copy your AccountSID (Ex: ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) and replace the value
account_sidin the fileCONFIG.ini - Copy your AuthToken (Ex: 5eXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) and replace the value
auth_tokeninCONFIG.ini - Finally for configuring variables, change
from_inCONFIG.inito your Twilio number. - On the Twilio Site, go to Numbers (Main Black bar on Twilio site)
- Click your # > Scroll Down to
SMS & MMS - 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
Log in or sign up for Devpost to join the conversation.