Uh oh! We couldn’t find any match.

Please try other search keywords.

Bixby Developer Center



The example.audio sample capsule demonstrates how to play audio files in your capsule by importing the bixby.audioPlayer library capsule:

capsule-imports {
import (bixby.audioPlayer) {
version (0.3.1)
as (audioPlayer)

You can test this sample capsule in the Simulator using the following utterance:

nl (Meow)

When testing capsules that import the audioPlayer library capsule, the Simulator will automatically display playback controls that simulate the device's implementation. For more information, see Testing Audio.

Download Capsule


Because you cannot submit a capsule with the example namespace, in order to test a sample capsule on a device, you must change the id in the capsule.bxb file from example to your organization's before making a private submission.

For example, if your namespace is acme, change example.audio to acme.audio.

In order to support playing audio in your capsule:

  1. Build an AudioInfo model, which handles the streaming information for the client audio player as well as other meta-data related to the audio clip you want to play
  2. Use a computed-input to pass the audioInfo model to the client audio player

This sample capsule shows how to do these steps.

Build an AudioInfo Model

The AudioInfo model is the primary concept model of the bixby.audioPlayer library capsule. It contains the AudioItem model, which the Bixby Audio Player actually streams, as well as additional inputs that are required to play the audio.

In the sample capsule, the BuildMeowAudioInfo action model creates this AudioInfo by outputting audioPlayer.AudioInfo.

action (BuildMeowAudioInfo) {
type (Search)
description (Makes a meow info to play.)
output (audioPlayer.AudioInfo)

The corresponding JavaScript file actually structures a specific input object, which specifies a category, displayName, and repeatMode. Additionally, there is an array of audioItem objects, which contain information about each audio file to be streamed. Here is an example audioItem:

id: 1,
stream: [
url: "https://storage.googleapis.com/bixby-audio-player-example/meows/203121_777645-lq.mp3",
format: "mp3"
title: "Cat-ch Phrase",
subtitle: "Meow.",
artist: "Cool Cat",
albumName: "Catatonic",
albumArtUrl: "https://storage.googleapis.com/bixby-audio-player-example/meows/cat-08.jpg"

All these properties together create an AudioInfo object that can be returned for the client audio player.

Pass the AudioInfo Model

After an AudioInfo structure is created, this needs to be passed back to the client, so that the clip can be played. This is done in the PlayMeow action. This action collects a meowToPlay input from a user, builds an AudioInfo item with BuildMeowAudioInfo, and sends it to the audio player using a computed-input:

computed-input (meow) {
description (By passing in the AudioInfo object to the PlayAudio action, we ask the client to play our sound.)
type (audioPlayer.Result)
compute {
intent {
goal: audioPlayer.PlayAudio
value: $expr(meowToPlay)

The PlayMeow action is basically a specialized action to get the AudioInfo by invoking BuildMeowAudioInfo and then passing it back to the client in the computed-input as part of the PlayAudio action in the bixby.audio library capsule.