The audio-playback interface

The audio-playback interface allows a snap to play sounds and music, via the supporting audio service running on the system, such as PulseAudio. It’s used by many applications and utilities, and as such, is enabled by default.

Audio recording is enabled with the companion audio-record interface, and unlike audio-playback, is not enabled (auto-connected) by default.

Example

The VLC snap is a good example of an application using the audio-playback interface:

$ snap connections vlc
Interface               Plug                        Slot                     Notes
audio-playback          vlc:audio-playback          :audio-playback          -
audio-record            vlc:audio-record            -                        -

If for some reason you want to disable audio playback for a snap, use the disconnect command:

snap disconnect vlc:audio-playback

The connect command can be used to re-enable audio playback:

snap connect vlc:audio-playback
Interface documentation:

See Interface management and Supported interfaces for further details on how interfaces are used.


Developer details

Auto-connect: yes

Code examples

The snapcraft.yaml for VLC includes audio-playback configuration: https://github.com/videolan/vlc/blob/master/extras/package/snap/snapcraft.yaml

The source code for this interface is in the snapd repository: https://github.com/snapcore/snapd/blob/master/interfaces/builtin/audio_playback.go


Last updated 11 months ago.