Documentation
¶
Index ¶
- Constants
- type AnalyserNode
- func (analyser AnalyserNode) FFTSize() int
- func (analyser AnalyserNode) FrequencyBinCount() int
- func (analyser AnalyserNode) FrequencyData() FrequencyDataBytes
- func (analyser AnalyserNode) MaxDecibels() int
- func (analyser AnalyserNode) MinDecibels() int
- func (analyser AnalyserNode) SetFFTSize(value int)
- func (analyser AnalyserNode) SetMaxDecibels(value int)
- func (analyser AnalyserNode) SetMinDecibels(value int)
- func (analyser AnalyserNode) SetSmoothingTimeConstant(value float64)
- func (analyser AnalyserNode) SmoothingTimeConstant() float64
- func (analyser AnalyserNode) TimeDomain() TimeDomainBytes
- type AtTime
- func (param AtTime) Cancel(values []float64, duration float64)
- func (param AtTime) CancelAndHold()
- func (param AtTime) ExponentialRampTo(value float64)
- func (param AtTime) LinearRampTo(value float64)
- func (param AtTime) Set(value float64)
- func (param AtTime) SetCurve(values []float64, duration float64)
- func (param AtTime) SetTarget(target, timeConstant float64)
- type AudioContext
- func (context AudioContext) Analyser() AnalyserNode
- func (context AudioContext) BiquadFilter() BiquadFilterNode
- func (context AudioContext) CurrentTime() float64
- func (context AudioContext) Destination() DestinationNode
- func (context AudioContext) Gain() GainNode
- func (context AudioContext) MediaStreamSource(stream MediaStream) MediaStreamSourceNode
- func (context AudioContext) Oscillator() OscillatorNode
- func (context AudioContext) Resume()
- func (context AudioContext) SampleRate() int
- func (context AudioContext) State() AudioContextState
- type AudioContextState
- type AudioNode
- func (node AudioNode) Channels() int
- func (node AudioNode) ChannelsInterpretation() ChannelsMode
- func (node AudioNode) ChannelsMode() ChannelsMode
- func (node AudioNode) Connect(destination AudioNode, inputIndex int, outputIndex int)
- func (node AudioNode) Context() AudioContext
- func (node AudioNode) Disconnect(destination AudioNode)
- func (node AudioNode) DisconnectAll()
- func (node AudioNode) Inputs() int
- func (node AudioNode) Outputs() int
- type AudioParam
- type BiquadFilterNode
- type Channels
- type ChannelsMode
- type DestinationNode
- type FilterType
- type FrequencyDataBytes
- type GainNode
- type MediaStream
- type MediaStreamSourceNode
- type OscillatorNode
- type Shape
- type TimeDomainBytes
- type Value
Constants ¶
const ( AudioContextStateSuspended = AudioContextState("suspended") AudioContextStateRunning = AudioContextState("running") AudioContextStateClosed = AudioContextState("closed") )
const ( ChannelsModeMax = ChannelsMode("max") ChannelsModeClampedMax = ChannelsMode("clamped-max") ChannelsModeExplicit = ChannelsMode("explicit") )
const ( FilterTypeLowPass = FilterType("lowpass") FilterTypeHighPass = FilterType("highpass") FilterTypeBandPass = FilterType("bandpass") FilterTypeLowShelf = FilterType("lowshelf") FilterTypeHighShelf = FilterType("highshelf") FilterTypePeaking = FilterType("peaking") FilterTypeNotch = FilterType("notch") FilterTypeAllPass = FilterType("allpass") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyserNode ¶
type AnalyserNode struct {
AudioNode
}
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode
func (AnalyserNode) FFTSize ¶
func (analyser AnalyserNode) FFTSize() int
FFTSize represents the window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data. https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize
func (AnalyserNode) FrequencyBinCount ¶
func (analyser AnalyserNode) FrequencyBinCount() int
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/frequencyBinCount
func (AnalyserNode) FrequencyData ¶
func (analyser AnalyserNode) FrequencyData() FrequencyDataBytes
func (AnalyserNode) MaxDecibels ¶
func (analyser AnalyserNode) MaxDecibels() int
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/msxDecibels
func (AnalyserNode) MinDecibels ¶
func (analyser AnalyserNode) MinDecibels() int
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/minDecibels
func (AnalyserNode) SetFFTSize ¶
func (analyser AnalyserNode) SetFFTSize(value int)
FFTSize represents the window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data. https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize
func (AnalyserNode) SetMaxDecibels ¶
func (analyser AnalyserNode) SetMaxDecibels(value int)
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/maxDecibels
func (AnalyserNode) SetMinDecibels ¶
func (analyser AnalyserNode) SetMinDecibels(value int)
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/minDecibels
func (AnalyserNode) SetSmoothingTimeConstant ¶
func (analyser AnalyserNode) SetSmoothingTimeConstant(value float64)
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/smoothingTimeConstant
func (AnalyserNode) SmoothingTimeConstant ¶
func (analyser AnalyserNode) SmoothingTimeConstant() float64
https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/smoothingTimeConstant
func (AnalyserNode) TimeDomain ¶
func (analyser AnalyserNode) TimeDomain() TimeDomainBytes
type AtTime ¶
type AtTime struct {
// contains filtered or unexported fields
}
AtTime is a namespace of operations on AudioParam that are scheduled at specified time. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam#Methods
func (AtTime) Cancel ¶
Cancel cancels all scheduled future changes to the AudioParam. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/cancelScheduledValues
func (AtTime) CancelAndHold ¶
func (param AtTime) CancelAndHold()
CancelAndHold cancels all scheduled future changes to the AudioParam but holds its value at a given time until further changes are made using other methods. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/cancelAndHoldAtTime
func (AtTime) ExponentialRampTo ¶
ExponentialRampTo schedules a gradual exponential change in the value of the AudioParam. The change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the `time` parameter. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/exponentialRampToValueAtTime
func (AtTime) LinearRampTo ¶
LinearRampTo schedules a gradual linear change in the value of the AudioParam. The change starts at the time specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the `time` parameter. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime
func (AtTime) Set ¶
Set schedules an instant change to the AudioParam value at a precise time, as measured against AudioContext.CurrentTime. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/setValueAtTime
func (AtTime) SetCurve ¶
SetCurve schedules the parameter's value to change following a curve defined by a list of values. The curve is a linear interpolation between the sequence of values defined in an array of floating-point values, which are scaled to fit into the given interval starting at `time` and a specific `duration`. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/setValueCurveAtTime
func (AtTime) SetTarget ¶
SetTarget schedules the start of a gradual change to the AudioParam value. This is useful for decay or release portions of ADSR envelopes. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/setTargetAtTime
type AudioContext ¶
AudioContext represents an audio-processing graph built from audio modules linked together, each represented by an AudioNode. An audio context controls both the creation of the nodes it contains and the execution of the audio processing, or decoding. You need to create an AudioContext before you do anything else, as everything happens inside a context. https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext https://developer.mozilla.org/en-US/docs/Web/API/AudioContext
func (AudioContext) Analyser ¶
func (context AudioContext) Analyser() AnalyserNode
func (AudioContext) BiquadFilter ¶
func (context AudioContext) BiquadFilter() BiquadFilterNode
func (AudioContext) CurrentTime ¶
func (context AudioContext) CurrentTime() float64
Current time returns an ever-increasing hardware time in seconds used for scheduling. It starts at 0. https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/currentTime
func (AudioContext) Destination ¶
func (context AudioContext) Destination() DestinationNode
Destination is the final destination of all audio in the context. It often represents an actual audio-rendering device such as your device's speakers. https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/destination
func (AudioContext) Gain ¶
func (context AudioContext) Gain() GainNode
Gain creates a GainNode, which can be used to control the overall volume of the audio graph. https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createGain https://developer.mozilla.org/en-US/docs/Web/API/GainNode
func (AudioContext) MediaStreamSource ¶
func (context AudioContext) MediaStreamSource(stream MediaStream) MediaStreamSourceNode
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaStreamSource
func (AudioContext) Oscillator ¶
func (context AudioContext) Oscillator() OscillatorNode
https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createOscillator https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode
func (AudioContext) Resume ¶
func (context AudioContext) Resume()
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/resume
func (AudioContext) SampleRate ¶
func (context AudioContext) SampleRate() int
SampleRate returns the sample rate (in samples per second) used by all nodes in this context. https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/sampleRate
func (AudioContext) State ¶
func (context AudioContext) State() AudioContextState
type AudioContextState ¶
type AudioContextState string
type AudioNode ¶
https://developer.mozilla.org/en-US/docs/Web/API/AudioNode
func (AudioNode) ChannelsInterpretation ¶
func (node AudioNode) ChannelsInterpretation() ChannelsMode
func (AudioNode) ChannelsMode ¶
func (node AudioNode) ChannelsMode() ChannelsMode
func (AudioNode) Context ¶
func (node AudioNode) Context() AudioContext
Context returns the associated AudioContext, that is the object representing the processing graph the node is participating in. https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/context
func (AudioNode) Disconnect ¶
func (AudioNode) DisconnectAll ¶
func (node AudioNode) DisconnectAll()
func (AudioNode) Inputs ¶
Inputs returns the number of inputs feeding the node. https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/numberOfInputs
func (AudioNode) Outputs ¶
Outputs returns the number of outputs coming out of the node. https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/numberOfOutputs
type AudioParam ¶
type AudioParam struct {
// contains filtered or unexported fields
}
https://developer.mozilla.org/en-US/docs/Web/API/AudioParam
func (AudioParam) AtTime ¶
func (param AudioParam) AtTime(time float64) AtTime
AtTime returns a namespace of operations on AudioParam that are scheduled at specified time. https://developer.mozilla.org/en-US/docs/Web/API/AudioParam#Methods
func (AudioParam) Default ¶
func (param AudioParam) Default() float64
func (AudioParam) Get ¶
func (param AudioParam) Get() float64
func (AudioParam) Max ¶
func (param AudioParam) Max() float64
func (AudioParam) Min ¶
func (param AudioParam) Min() float64
func (AudioParam) Set ¶
func (param AudioParam) Set(value float64)
type BiquadFilterNode ¶
type BiquadFilterNode struct {
AudioNode
}
https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode
func (BiquadFilterNode) DeTune ¶
func (node BiquadFilterNode) DeTune() AudioParam
https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/detune
func (BiquadFilterNode) FilterType ¶
func (node BiquadFilterNode) FilterType() FilterType
FilterType is kind of filtering algorithm the node is implementing https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/type
func (BiquadFilterNode) Frequency ¶
func (node BiquadFilterNode) Frequency() AudioParam
https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/frequency
func (BiquadFilterNode) Gain ¶
func (node BiquadFilterNode) Gain() AudioParam
https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/gain
func (BiquadFilterNode) QFactor ¶
func (node BiquadFilterNode) QFactor() AudioParam
https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/Q
type Channels ¶
type Channels struct {
// contains filtered or unexported fields
}
func (Channels) Discrete ¶
https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelInterpretation
func (Channels) Mode ¶
func (channels Channels) Mode() ChannelsMode
https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelCountMode
type ChannelsMode ¶
type ChannelsMode string
type DestinationNode ¶
type DestinationNode struct {
AudioNode
}
func (DestinationNode) MaxChannels ¶
func (node DestinationNode) MaxChannels() int
type FilterType ¶
type FilterType string
type FrequencyDataBytes ¶
type FrequencyDataBytes struct { Size int // Size of the data array Data []byte // where to copy data from JS into Go // contains filtered or unexported fields }
func (*FrequencyDataBytes) Update ¶
func (freq *FrequencyDataBytes) Update()
Update reads the current frequency data into `Data` attribute. The frequency data is composed of integers on a scale from 0 to 255.
type GainNode ¶
type GainNode struct {
AudioNode
}
GainNode represents a change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. https://developer.mozilla.org/en-US/docs/Web/API/GainNode
func (GainNode) Gain ¶
func (node GainNode) Gain() AudioParam
type MediaStream ¶
func (MediaStream) Active ¶
func (stream MediaStream) Active() bool
https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/active
func (MediaStream) Clone ¶
func (stream MediaStream) Clone() MediaStream
https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/clone
func (MediaStream) ID ¶
func (stream MediaStream) ID() string
https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/id
func (MediaStream) JSValue ¶ added in v0.3.0
func (stream MediaStream) JSValue() js.Value
Casts audio.MediaStream to js.Value
type MediaStreamSourceNode ¶
type MediaStreamSourceNode struct {
AudioNode
}
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamAudioSourceNode
func (MediaStreamSourceNode) Stream ¶
func (node MediaStreamSourceNode) Stream() MediaStream
type OscillatorNode ¶
type OscillatorNode struct {
AudioNode
}
https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode
func (OscillatorNode) DeTune ¶
func (node OscillatorNode) DeTune() AudioParam
func (OscillatorNode) Frequency ¶
func (node OscillatorNode) Frequency() AudioParam
func (OscillatorNode) SetShape ¶
func (node OscillatorNode) SetShape(shape Shape)
func (OscillatorNode) Shape ¶
func (node OscillatorNode) Shape() Shape
Shape specifies the shape of waveform to play. https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/type
func (OscillatorNode) Start ¶
func (node OscillatorNode) Start(when float64)
https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/start
func (OscillatorNode) Stop ¶
func (node OscillatorNode) Stop(when float64)
https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/stop
type TimeDomainBytes ¶
type TimeDomainBytes struct { Size int // Size of the data array Data []byte // where to copy data from JS into Go // contains filtered or unexported fields }
func (*TimeDomainBytes) Update ¶
func (domain *TimeDomainBytes) Update()
Update reads the current waveform or time-domain into `Data` attribute.
type Value ¶
Value is an extended js.Value with more types support
func (Value) OptionalString ¶
OptionalString returns empty string if Value is null