audioengine

package
v0.0.0-...-17a3ff8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

The audioengine package creates a portaudio stream and synthesises audio samples into the stream using Voices it receives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControlVoices

func ControlVoices(waitGroup *sync.WaitGroup, voiceReceiveChan chan SynthVoice, sampleRate float64, voiceLimit int)

ControlVoices receives voices from the voiceReceiveChan and stages them for activation by the voice controller. It also implements voice stealing by marking the oldest voice for death if a maximum number of activated voices is exceeded.

Types

type SynthVoice

type SynthVoice interface {
	ShouldDie() bool
	KillOnNextCycle()
	SynthesizeSample() float32
	IncrementAgeInSamples()
}

type VoiceController

type VoiceController struct {
	*portaudio.Stream
	// contains filtered or unexported fields
}

VoiceController provides a portaudio output stream and attributes for keeping track of currently enabled voices.

Jump to

Keyboard shortcuts

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