font

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Package font provides utilities to package together audio manipulations as a 'font'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audio

type Audio struct {
	*Font
	audio.FullAudio
	// contains filtered or unexported fields
}

Audio is an ease-of-use wrapper around an audio with an attached font, so that the audio can be played with .Play() but can take in the remotely variable font filter options.

Note that it is a conscious choice for both Font and Audio to have a Filter(...Filter) function, so that when a FontAudio is in use the user needs to specify which element they want to apply a filter on. The alternative would be to have two similarly named functions, and its believed that fa.Font.Filter(...) and fa.Audio.Filter(...) is more or less equivalent to whatever those names would be.

func NewAudio

func NewAudio(f *Font, a audio.FullAudio) *Audio

NewAudio returns a *FontAudio. For preparation against API changes, using NewAudio over Audio{} is recommended.

func (*Audio) Play

func (ad *Audio) Play() <-chan error

Play is equivalent to Audio.Font.Play(a.Audio)

func (*Audio) Stop

func (ad *Audio) Stop() error

Stop stops a font.Audio's playback

type Font

type Font struct {
	Filters []audio.Filter
}

Font represents some group of settings which modify how an Audio should be played. The name is derived from the concept of a SoundFont

func New

func New() *Font

New returns a *Font. It is recommended for future API changes to avoid &Font{} and use NewFont instead

func (*Font) Filter

func (f *Font) Filter(fs ...audio.Filter) *Font

Filter on a font is applied to all audios as they are played. Each call of Filter will completely reset a Font's filters

func (*Font) Play

func (f *Font) Play(a audio.Audio) <-chan error

Play on a font is equivalent to Audio.Copy().Filter(Font.GetFilters()).Play()

Directories

Path Synopsis
Package ceol provides functionality to handle .ceol files and .ceol encoded data (Bosca Ceoil files).
Package ceol provides functionality to handle .ceol files and .ceol encoded data (Bosca Ceoil files).
Package dls contains data structures for DLS (.dls) file types.
Package dls contains data structures for DLS (.dls) file types.
Package riff reads and umarshalls RIFF files.
Package riff reads and umarshalls RIFF files.

Jump to

Keyboard shortcuts

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