webaudio

package module
v0.0.0-...-eddf252 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2016 License: BSD-2-Clause Imports: 8 Imported by: 0

README

webaudio

WebAudio API for golang

Documentation

Index

Constants

View Source
const (
	CZ  = 2 // bytes/1-sample for al.FormatMono16
	Fmt = al.FormatMono16
)
View Source
const (
	Pi = float32(math.Pi)
)

Variables

View Source
var SampleRate = float32(44100.0)

Functions

This section is empty.

Types

type AudioBuffer

type AudioBuffer struct {
	// contains filtered or unexported fields
}

func (*AudioBuffer) ChannelData

func (b *AudioBuffer) ChannelData(n int) []float32

type AudioContext

type AudioContext struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() (*AudioContext, error)

func (*AudioContext) Close

func (c *AudioContext) Close()

func (*AudioContext) CreateBuffer

func (c *AudioContext) CreateBuffer(numOfChannels, length, sampleRate int) *AudioBuffer

func (*AudioContext) CreateGain

func (c *AudioContext) CreateGain() *GainNode

func (*AudioContext) CreateOscillator

func (c *AudioContext) CreateOscillator() *OscillatorNode

func (*AudioContext) Destination

func (c *AudioContext) Destination() *AudioDestinationNode

func (*AudioContext) SampleRate

func (c *AudioContext) SampleRate() float32

type AudioDestinationNode

type AudioDestinationNode struct {
	*AudioNode
	*EventTarget
}

type AudioNode

type AudioNode struct {
	sync.RWMutex
	*InputImpl
	*OutputImpl
	// contains filtered or unexported fields
}

func (*AudioNode) Close

func (n *AudioNode) Close()

func (*AudioNode) Context

func (n *AudioNode) Context() *AudioContext

type AudioParam

type AudioParam struct {
	sync.RWMutex
	*InputImpl
	// contains filtered or unexported fields
}

func (*AudioParam) DefaultValue

func (p *AudioParam) DefaultValue() float32

func (*AudioParam) SetValue

func (p *AudioParam) SetValue(v float32)

func (*AudioParam) Value

func (p *AudioParam) Value() float32

type EndEvent

type EndEvent struct {
	// contains filtered or unexported fields
}

func NewEndEvent

func NewEndEvent(target interface{}) *EndEvent

func (*EndEvent) String

func (e *EndEvent) String() string

func (*EndEvent) Type

func (e *EndEvent) Type() string

type Event

type Event interface {
	Type() string
	String() string
}

Event ...

type EventTarget

type EventTarget struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

EventTarget ...

func (*EventTarget) AddEventListener

func (et *EventTarget) AddEventListener(typ string, useCapture bool, cb interface{})

AddEventListener ...

func (*EventTarget) DispatchEvent

func (et *EventTarget) DispatchEvent(e Event)

DispatchEvent ...

func (*EventTarget) RemoveEventListener

func (et *EventTarget) RemoveEventListener(typ string, useCapture bool, cb interface{})

RemoveEventListener ...

type GainNode

type GainNode struct {
	sync.RWMutex

	*AudioNode
	*EventTarget
	// contains filtered or unexported fields
}

func (*GainNode) Connect

func (g *GainNode) Connect(i Input) error

func (*GainNode) Gain

func (g *GainNode) Gain() *AudioParam

type Input

type Input interface {
	NumberOfInputs() int
	// contains filtered or unexported methods
}

type InputImpl

type InputImpl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*InputImpl) NumberOfInputs

func (i *InputImpl) NumberOfInputs() int

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

Listener ...

func NewListener

func NewListener(cb interface{}) Listener

func (Listener) Handle

func (l Listener) Handle(e Event)

func (Listener) Type

func (l Listener) Type() string

type OscillatorNode

type OscillatorNode struct {
	sync.RWMutex

	*AudioNode
	*EventTarget
	// contains filtered or unexported fields
}

func (*OscillatorNode) Connect

func (o *OscillatorNode) Connect(i Input) error

func (*OscillatorNode) Detune

func (o *OscillatorNode) Detune() *AudioParam

func (*OscillatorNode) Frequency

func (o *OscillatorNode) Frequency() *AudioParam

func (*OscillatorNode) SetType

func (o *OscillatorNode) SetType(t string) error

func (*OscillatorNode) Start

func (o *OscillatorNode) Start(d float32)

func (*OscillatorNode) Stop

func (o *OscillatorNode) Stop(d float32)

func (*OscillatorNode) Type

func (o *OscillatorNode) Type() string

type Output

type Output interface {
	Disconnect()
	NumberOfOutputs() int
	// contains filtered or unexported methods
}

type OutputImpl

type OutputImpl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*OutputImpl) Disconnect

func (o *OutputImpl) Disconnect()

func (*OutputImpl) NumberOfOutputs

func (o *OutputImpl) NumberOfOutputs() int

Jump to

Keyboard shortcuts

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