AudioStreamSample

Stores audio data loaded from WAV files.

AudioStreamSample stores sound samples loaded from WAV files. To play the stored sound, use an AudioStreamPlayer (for non-positional audio) or AudioStreamPlayer2D/AudioStreamPlayer3D (for positional audio). The sound can be looped. This class can also be used to store dynamically-generated PCM audio data.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
Format
enum Format
LoopMode
enum LoopMode

Functions

getData
PoolByteArray getData()
getFormat
AudioStreamSample.Format getFormat()
getLoopBegin
long getLoopBegin()
getLoopEnd
long getLoopEnd()
getLoopMode
AudioStreamSample.LoopMode getLoopMode()
getMixRate
long getMixRate()
isStereo
bool isStereo()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(AudioStreamSample other)
opEquals
bool opEquals(typeof(null) n)
saveToWav
GodotError saveToWav(String path)

Saves the AudioStreamSample as a WAV file to path. Samples with IMA ADPCM format can't be saved. Note: A .wav extension is automatically appended to path if it is missing.

setData
void setData(PoolByteArray data)
setFormat
void setFormat(long format)
setLoopBegin
void setLoopBegin(long loop_begin)
setLoopEnd
void setLoopEnd(long loop_end)
setLoopMode
void setLoopMode(long loop_mode)
setMixRate
void setMixRate(long mix_rate)
setStereo
void setStereo(bool stereo)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

data
PoolByteArray data [@property getter]
PoolByteArray data [@property setter]

Contains the audio data in bytes. Note: This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte.

format
AudioStreamSample.Format format [@property getter]
long format [@property setter]

Audio format. See format constants for values.

loopBegin
long loopBegin [@property getter]
long loopBegin [@property setter]

The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present.

loopEnd
long loopEnd [@property getter]
long loopEnd [@property setter]

The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present.

loopMode
AudioStreamSample.LoopMode loopMode [@property getter]
long loopMode [@property setter]

The loop mode. This information will be imported automatically from the WAV file if present. See loopmode constants for values.

mixRate
long mixRate [@property getter]
long mixRate [@property setter]

The sample rate for mixing this audio.

stereo
bool stereo [@property getter]
bool stereo [@property setter]

If true, audio is stereo.

Static functions

_new
AudioStreamSample _new()

Construct a new instance of AudioStreamSample. Note: use memnew!AudioStreamSample instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta