declare namespace openfl.media { /** * The SoundTransform class contains properties for volume and panning. * * @see [Controlling sound volume and panning](https://books.openfl.org/openfl-developers-guide/working-with-sound/controlling-sound-volume-and-panning.html) * @see `openfl.media.Sound` * @see `openfl.media.SoundChannel.soundTransform` * */ export class SoundTransform { /** * Creates a SoundTransform object. * * @param vol The volume, ranging from 0 (silent) to 1 (full volume). * @param panning The left-to-right panning of the sound, ranging from -1 * (full pan left) to 1 (full pan right). A value of 0 * represents no panning (center). * */ constructor(vol?: number, panning?: number); /** * A value, from 0 (none) to 1 (all), specifying how much of the left input * is played in the left speaker. * */ leftToLeft: number; /** * A value, from 0 (none) to 1 (all), specifying how much of the left input * is played in the right speaker. * */ leftToRight: number; /** * The left-to-right panning of the sound, ranging from -1 (full pan left) * to 1 (full pan right). A value of 0 represents no panning (balanced * center between right and left). * * The following example sets the pan to 0.5 (half pan right) when * starting to play a Sound. * * ```haxe * var transform = new SoundTransform(1.0, 0.5); * var soundChannel = sound.play(0, 0, transform); * ``` * * The following example sets the pan to -1 (full pan left) for a * SoundChannel that is currently playing. * * ```haxe * var transform = soundChannel.soundTransform; * transform.pan = -1.0; * soundChannel.soundTransform = transform; * ``` * * @see [Controlling sound volume and panning](https://books.openfl.org/openfl-developers-guide/working-with-sound/controlling-sound-volume-and-panning.html) * */ pan: number; /** * A value, from 0 (none) to 1 (all), specifying how much of the right * input is played in the left speaker. * */ rightToLeft: number; /** * A value, from 0 (none) to 1 (all), specifying how much of the right * input is played in the right speaker. * */ rightToRight: number; /** * The volume, ranging from 0 (silent) to 1 (full volume). * * The following example sets the volume to 0.5 (half volume) when * starting to play a Sound. * * ```haxe * var transform = new SoundTransform(0.5); * var soundChannel = sound.play(0, 0, transform); * ``` * * The following example sets the volume to 0.0 (silent) for a * SoundChannel that is currently playing. * * ```haxe * var transform = soundChannel.soundTransform; * transform.volume = 0.0; * soundChannel.soundTransform = transform; * ``` * * @see [Controlling sound volume and panning](https://books.openfl.org/openfl-developers-guide/working-with-sound/controlling-sound-volume-and-panning.html) * */ volume: number; } } export default openfl.media.SoundTransform;