Bixby AudioPlayer

Learn more about how to use the Bixby AudioPlayer functionality.

Introduction

The AudioPlayer functionality can be used to stream any number of audio files, such as music or podcasts.

If you want to start a new AudioPlayer capsule with the intent of using the platform integration with the Jovo Framework, we recommend to start with our Bixby AudioPlayer Template. It comes with a very easy setup for using the AudioPlayer functionality, as well as all the Jovo models required for the integration to work properly. You can download it using the following command:

Prerequisites

Provide AudioPlayer-specific Bixby structures

To use the AudioPlayer functionality for Bixby, you need to add and train on a respective action, which will tell Bixby to expect required parameters to construct an audioplayer element.

Go ahead and add the following action to your actions/ folder:

Now, in your training tool, add a sample utterance for this action. As the goal, enter JovoPlayAudioAction, which is a predefined action inside models/Jovo/actions/. It uses the computed-input functionality and constructs a structure of type audioPlayer.Result based on the _JOVO_AUDIO_ property in JovoResponse.

Learn more about computed-inputs here.

However, this won't work yet, as Bixby doesn't know where the JovoResponse comes from. We need a way of telling Bixby, that the goal is JovoPlayAudioAction, but the input property comes from our PlayAudioAction we just created. Fortunately, there is a way to achieve this. When editing the training phrase inside the training tool, there is a little grey bar on the left side of the input field. When you click on that, a new window appears, which allows you to create a route for your utterance, specifying what route to take when this utterance is triggered to achieve the desired goal.

Training Example

Add a directive to your handler

As soon as your audio response is being handled by Bixby, it sends out a directive to your voice app, indicating that audio is about to be played. You must register that directive in your handler. If you want to return a response before the audio is being played, you need to do that in the directive.

The last thing you need to do is to register that directive inside your endpoints.bxb file.

Usage

Now that your capsule is ready for the AudioPlayer functionality, you can start using it in your code.

You can access the plugin like this:

Play

Enqueue

Meta Data

Comments and Questions

Any specific questions? Just drop them below or join the Jovo Community Forum.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.