Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

Latest commit

 

History

History
50 lines (39 loc) · 1.63 KB

File metadata and controls

50 lines (39 loc) · 1.63 KB

SoundSystem

Sound system for CR. Supports text to speech and jingle play based on system commands 'say' and 'afplay'

Directory scanning

In application.properties file the property jingle.path point to the directory with jingles files. This directory will be scanned on application startup.

API

Following endpoints are available:

  • /say - send POST request to schedule text to speach, body of the post will be spoken
  • /play - send POST request to schedule jingle play, accepts filename to play (handles filenames with and without extension)
  • /records lists - send GET request to get list of sound records (include request time, start of execution, end of execution, body of request, and response body)

Examples

Text to speach

Request: POST localhost:8080/say with body hello

Response: Scheduled to say: dataflow stuck

Play jingle

Request: POST localhost:8080/play with body example.wmv

Response: Scheduled to play jingle: example.wmv

Browse sound records

Request: GET localhost:8080/records

Response:

[
    {
        "requestType": "say",
        "requestBody": "dataflow stuck",
        "called": "2018-08-30T16:14:04.399+0000",
        "executionStarted": "2018-08-30T16:14:04.441+0000",
        "executionFinished": "2018-08-30T16:14:05.632+0000",
        "response": "Scheduled to say: dataflow stuck"
    },
    {
        "requestType": "play",
        "requestBody": "example.wmv",
        "called": "2018-08-30T16:14:39.399+0000",
        "executionStarted": "2018-08-30T16:14:39.400+0000",
        "executionFinished": "2018-08-30T16:14:47.875+0000",
        "response": "Scheduled to play jingle: example.wmv"
    }
]