Git Product home page Git Product logo

garmin-audio-example's Introduction

MonkeyMusic

MonkeyMusic is a basic audio content provider app implementation that includes a simple Python-based media server.

The Server

In order to test the MonkeyMusic app, you must have a media server to host the audio content. We've included a sample server written in Python and some sample media for testing. Before attempting to run the server, install a Python 2.7 interpreter, which can be downloaded from the Python website at https://www.python.org/downloads/.

Running the Server

  1. Open a Command Prompt/Terminal.

  2. Check to make sure Python is in your path. An easy way to do this is to run python -V from the command line. If Python is properly installed, the Python version should be displayed:

    C:\Users\vitek>python -V
    Python 2.7.10
    

    If you do not see a Python version number in the output, you will need to troubleshoot your installation. This typically involves modifying the PATH environment variable.

  3. Change directories to the MonkeyMusic project root folder, which contains the project manifest.xml file:

    C:\Users\vitek>cd C:\Projects\connectiq-apps\audio-provider\monkeymusic
    C:\Projects\connectiq-apps\audio-provider\monkeymusic>
    
  4. Start the MonkeyMusic media server on port 8000:

    C:\Projects\connectiq-apps\audio-provider\monkeymusic>python -m CGIHTTPServer
    Serving HTTP on 0.0.0.0 port 8000 ...
    
  5. If you'd like to verify that the media server is working, you can visit http://localhost:8000/cgi-bin/media.py in a web browser, which should display a page with the following message:

    There was an error in your request
    

The Client

Once the server is running, the client application can be used to obtain and play back content. An audio content provider app can run in one of four modes:

  1. Configure Sync
  2. Sync
  3. Configure Playback
  4. Playback

The steps below demonstrate each of the modes.

Note: This assumes that you have the Eclipse IDE installed and configured for Connect IQ development. See the Getting Started chapter of the Connect IQ Programmer's Guide for more information

Running the Client

  1. Open Eclipse and import the MonkeyMusic project.
  2. Create a Run Configuration for the MonkeyMusic project using the Forerunner 645M device.
  3. Run the sample in the Connect IQ simulator.
  4. Disable Settings > Use Device HTTPS Requirements, so that the simulated device can connect to the server over HTTPS.

NOTE: This will not cause a security issue while you are connecting locally in the simulator. When you deploy your app however, any endpoints you connect to should be secured with HTTPS.

  1. Choose Settings > Media Mode > Sync Configuration from the simulator top menu.
  2. Select one or more tracks from the displayed list of downloadable tracks.
  3. Select Done from the menu, and the app will exit.
  4. Run the sample in the simulator again.
  5. Choose Settings > Media Mode > Sync from the simulator top menu. A progress bar will appear while the download is in progress.
  6. When completed, press or swipe Back, and the app will exit.
  7. Run the sample in the simulator again.
  8. Choose Settings > Media Mode > Playback Configuration from the simulator top menu, and a list of downloaded tracks will appear.
  9. Select one or more tracks from the displayed list of downloaded tracks.
  10. Select Done from the menu, and the app will exit.
  11. Run the sample in the simulator again.
  12. Select Playback from the simulator top menu to display standard playback controls and current track information. Device inputs (buttons, touch screen, etc., depending on the devcie) can be used to control the selected track. No actual playback occurs.

garmin-audio-example's People

Contributors

agentsib avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.