Your webradio has now its own Alexa Skill! It supports audio and video streams. You can configure a preroll message with dynamic content from an API.
- Copy the file
config/app_config.yaml.dist
toconfig/app_config.yaml
and.env
to.env.local
- Edit the parameters insides the files to suit your needs. See Config for detailed instructions.
This file contains the technical parameters of the skill. See .env
for an example.
AMAZON_APP_ID
: Set this to the Skill ID from the Skill you created on the Alexa Developer ConsoleCONFIG_FILEPATH
: Path to the other configuration file. Should beconfig/app_config.yaml
.FALLBACK_URL
: URL of your webradio in case someone tries to connect to this app from a web browser.APP_DEBUG
: Set to 1 if you want to have more detailed logs when testing your appAPP_ENV
: Set toprod
ordev
APP_SECRET
: Set to a random string. Used by Symfony for security purposes.
This file contains the skill main configuration. See config/app_config.yaml.dist
for an example.
audio_stream_uri
: The https URL to your webradio audio stream. Set tonull
to disable.video_stream_uri
: The https URL to your webradio video stream. Set tonull
to disable.
Hooks are phrases pronounced by the Alexa device at specifics moments. It supports different languages.
beforePlayAudio
: Played just before the audio stream launch.beforePlayVideo
: Played just before the video stream launch.onAirAudio
: Played onOnAirIntent
with audio stream.onAirVideo
: Played onOnAirIntent
with video stream.
Those parameters sets the Alexa Device metadatas when playing. They accept static or dynamic values.
List the API endpoints available as dynamic data sources. Keys (api.live
in example file) are used as endpoint name. Then, specify url and type with the source
and type
keys respectively.
This skill supports dynamic data through XML of JSON APIs. First, define the API endpoint in the endpoints
section of the app_config.yaml
file.
In the hooks
or metadatas
paremeters, you can embed the dynamic values with this pattern: %[endpoint_name]:[path]%
where [endpoint_name]
is the endpoint name you set in the endpoints
parameter, and [path]
is the path to the property separated by dots.
Example: if your endpoint name is "live_api" and your JSON is { "show": { "title": "Show Title", "host": "Jared" }}
, you can embed the show title in the hooks with this string: "Welcome to %live_api:show.title% with %live_api:show.host%!"
Dynamic values may be missing from API for any reason. In those case, you can construct hooks sentences with optional parts. Simply put braces ({}
) around those parts. Example "Welcome to AwesomeRadio! {You're listening to %live_api:song.title% by %live_api:song.artist%!}"
. In this case, if any of the dynamic values is missing, the whole sentence will be skipped.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.