Alex Stone
Alex Stone

Reputation: 47344

iOS SiriKit can Siri play back audio clips on command?

I want to create a sound board type of app using SiriKit. However, I don’t see if Siri can play back audio on demand.

Does SirKit allow play back of custom audio clips from my app?

For example : Siri, play “cow says moo” -> audio clip is played. Is this possible?

Upvotes: 2

Views: 314

Answers (1)

pd95
pd95

Reputation: 2632

This is should definitely be possible but it needs your app to implement:

  1. the playback of audio clips (=using AVPlayer e.g. as a background audio player)
  2. an INPlayMediaIntentHandling intent handler which tries to map the media item (whose text representation is given in INMediaSearch.mediaName) to the correct snippet. Here you have to implement some laziness because the user could say "cow says moo" or "cow makes moo". After matching the item you can start the playback in your app.

Apple has released documentation about media handling with Siri which might help you further: https://developer.apple.com/documentation/sirikit/media/improving_siri_media_interactions_and_app_selection

Upvotes: 1

Related Questions