AudioEffectCapture

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer.

Application code should consume these audio frames from this ring buffer using GetBuffer and process it as needed, for example to capture data from an AudioStreamMicrophone, implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating-point PCM.

Unlike AudioEffectRecord, this effect only returns the raw audio samples instead of encoding them into an AudioStream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsAudioEffectCapture() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsAudioEffect

func (self *Extension[T]) AsAudioEffect() AudioEffect.Instance

func (*Extension[T]) AsAudioEffectCapture

func (self *Extension[T]) AsAudioEffectCapture() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.AudioEffectCapture

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsAudioEffect

func (self Instance) AsAudioEffect() AudioEffect.Instance

func (Instance) AsAudioEffectCapture

func (self Instance) AsAudioEffectCapture() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) BufferLength

func (self Instance) BufferLength() Float.X

Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized.

func (Instance) CanGetBuffer

func (self Instance) CanGetBuffer(frames int) bool

Returns true if at least 'frames' audio frames are available to read in the internal ring buffer.

func (Instance) ClearBuffer

func (self Instance) ClearBuffer()

Clears the internal ring buffer.

Note: Calling this during a capture can cause the loss of samples which causes popping in the playback.

func (Instance) GetBuffer

func (self Instance) GetBuffer(frames int) []Vector2.XY

Gets the next 'frames' audio samples from the internal ring buffer.

Returns a []Vector2.XY containing exactly 'frames' audio samples if available, or an empty []Vector2.XY if insufficient data was available.

The samples are signed floating-point PCM between -1 and 1. You will have to scale them if you want to use them as 8 or 16-bit integer samples. (v = 0x7fff * samples[0].x)

func (Instance) GetBufferLengthFrames

func (self Instance) GetBufferLengthFrames() int

Returns the total size of the internal ring buffer in frames.

func (Instance) GetDiscardedFrames

func (self Instance) GetDiscardedFrames() int

Returns the number of audio frames discarded from the audio bus due to full buffer.

func (Instance) GetFramesAvailable

func (self Instance) GetFramesAvailable() int

Returns the number of frames available to read using GetBuffer.

func (Instance) GetPushedFrames

func (self Instance) GetPushedFrames() int

Returns the number of audio frames inserted from the audio bus.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) SetBufferLength

func (self Instance) SetBufferLength(value Float.X)

SetBufferLength sets the property returned by [GetBufferLength].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

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