Audio is a service API, and isn’t a modifier system.
There is e.g the Sound modifier for placing sounds in the world.
Most things in Audio work on an instance (handle) of a sound.
You get one of those from play or loop, and then can modify or query it.
It’s always safe to call any function on an instance, even if it’s finished playing.
A quick look:
//play them
var sound = Audio.play(Asset.audio("assets/sound"))
var music = Audio.loop(Asset.audio("assets/music"))
Plays audio from the specified source with as3D and bus at volume volume.
The bus comes from create_bus, and 0 means global/default bus.
If as3D is true, use set3D on the handle returned to configure position/velocity.
Returns a handle to an audio instance that you can modify or stop.
Begins looping audio for id with as3D and bus at volume volume.
The bus comes from create_bus, and 0 means global/default bus.
If as3D is true, use set3D on the handle returned to configure position/velocity.
Returns a handle to an audio instance that you can modify or stop.
Adjusts the pitch of instance, making the sample sound higher or lower-pitched.
Pitch values below 1 will lower the pitch of the sample, while pitch values above 1 raise it.
A value of 1 will cause the sample to be played at its source pitch.
Pitch changes will affect playback duration, causing lower-pitched samples
to have longer durations and higher-pitched samples to have shorter durations,
because the audio is not resampled (when using this function).
The higher the rolloff factor, the more steeply the volume drops.
At low enough rolloff factor, the volume never drops near zero.
Values over 1 recommended (unless you have special needs).
Values less than equal to zero result in undefined behavior.
Increasing the minimum distance pushes the start of the attenuation further.
It also causes the curve to change. Note that the minimum distance must be above 0.
The maximum distance simply cuts the attenuation at the volume level it has reached at that point.
The rolloff factor for linear distance simply sets the maximum volume reduction.
Using values outside the 0..1 range causes undefined behavior.
The minimum and maximum distance works as one might expect.
Minimum distance must be less or equal to maximum distance.
The higher the rolloff factor, the more steeply the volume drops.
At low enough rolloff factor, the volume never drops near zero.
Values over 1 recommended (unless you have special needs).
Values less than equal to zero result in really weird behavior.
Increasing the minimum distance pushes the start of the attenuation further.
It also causes the curve to change. Note that the minimum distance must be above 0.
The maximum distance simply cuts the attenuation at the volume level it has reached at that point.