Skip to content

Player3

Matthew Martin edited this page Jun 19, 2020 · 2 revisions

Introduction

The player3 application is used to play audio files out from a soundcard or HAT attached to the Pi. It is called player3 as the expected use is to connect the output to a device expecting AES3.

Command Line Arguments

player3 takes a number of command line arguments

-v or --version

The application will output its current version and build time.

{
    "version": string - format is MAJOR.MINOR.PATCH.BUILD,
    "date": string - ISO date and time format showing when the version was built.
}

-d or --devices

The application will output details of all possible audio input/output devices attached to the computer

[
    {
        "version": integer - ,
        "name": string - user friendly name for the audio i/o device,
        "samplerate": integer - the default sample rate of the audio i/o device in Hz,
        "input":
        {
            "channels": integer - the maximum input channels the device supports,
            "latency":
            {
                "low": integer - default input latency for interactive performance,
                "high": integer - default input latency for robust performance
            }
        },
        "output":
        {
            "channels": integer - the maximum output channels the device supports,
            "latency":
            {
                "low": integer - default output latency for interactive performance,
                "high": integer - default output latency for robust performance
            }
        }
    },...
]

Default parameters

If -d and -v are not passed to the application then player3 expects 5 parameters to be passed in the following order

  • full path and file name of the config file
  • the type of resource to be played. One of
    • w - wav file (or other type that libsndfile can play)
    • m - mp3 file
    • p - playlist
    • s - schedule
  • the uid of the resource
  • the number of times to play the resource. Note -1 means play forever
  • shuffle - either
    • 0 - don't shuffle
    • 1 - shuffle

e.g.

player3 w 7bf495a7-2869-3977-9afbf4784ea4 -1 0

Usage

The application is launched by episerver when it receives a play command via the /x-epi/status endpoint.

The application will read the config file and the resources file and play out the audio as instructed. It outputs status messages in JSON format to stdout which are redirected and captured by episerver to be passed on via websockets.

Clone this wiki locally