Sound

The Sound service plays system alert sounds and audio files. Access it via app.sound. Playing does not block.

app.sound.play("Glass")
app.sound.play("~/Music/done.m4a", volume=0.5)

Methods

Method Returns Description
play(sound, volume=None) bool An alert sound name from names(), or the path of an audio file (AIFF, WAV, MP3, M4A...). True if it started. An unknown name raises nib.ServiceError
stop() None Stop every sound the app is playing
names() list[str] The alert sound names, including any the user installed in their Library