sounds

package
v0.0.0-...-ad46cc6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

README

Licenses:

message.opus is taken from `sound-theme-freedesktop` at
https://directory.fsf.org/wiki/Sound-theme-freedesktop. It is re-encoded from
the original .oga file to a low bitrate .opus file. It is licensed under
Creative Commons.

Documentation

Index

Constants

View Source
const (
	Bell    = "bell"
	Message = "message"
)

Sound IDs.

View Source
const DefaultVolume = 0.6

DefaultVolume is the default volume of the sound player.

Variables

View Source
var SoundsFS = []fs.FS{embeddedSoundsFS}

SoundsFS is a list of filesystems to search for sounds.

Functions

func Play

func Play(app *app.Application, id string)

Play plays the given sound ID. It first uses Canberra, falling back to ~/.cache/gotktrix/{id}.opus, then the embedded audio (if any), then display.Beep() otherwise.

Play is asynchronous; it returning does not mean the audio has successfully been played to the user.

func SetVolume

func SetVolume(v float64)

SetVolume sets the volume of the sound player. The volume is a float64 between 0 and 1. Values outside of this range will be clamped.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL