import { ObjectManager } from "../ObjectManager"; import { ObjectBase } from "../ObjectBase"; import { AudioFormat } from "../Enums"; /** * Defines properties of a sound object. * @see {@link SoundObject} */ export type SoundObjectProperties = { /** * The audio data. */ data: Uint8Array; /** * Audio format, empty means Auto. */ format?: AudioFormat; }; /** * Represents a sound object, which is a stream containing sample values * that define a sound to be played through the computer's speakers. */ export declare class SoundObject extends ObjectBase { /** * Creates empty instance of a {@link SoundObject} object. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link SoundObject}. */ constructor(om: ObjectManager); /** * Creates empty instance of a {@link SoundObject} object. */ constructor(); /** * Creates a {@link SoundObject} object on the base of properties specified by the * {@link SoundObjectProperties}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link SoundObject}. * @param properties - The properties of created object. */ constructor(om: ObjectManager, properties: SoundObjectProperties); /** * Creates a {@link SoundObject} object on the base of properties specified by the * {@link SoundObjectProperties}. * * @param properties - The properties of created object. */ constructor(properties: SoundObjectProperties); /** * Creates a {@link SoundObject} from audio data of WAF or AIFF format. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link SoundObject}. * @param audioData - The audio data. * @param format - The audio data format, not specified means 'Auto'. */ constructor(om: ObjectManager, audioData: Uint8Array, format?: AudioFormat); /** * Creates a {@link SoundObject} from audio data of WAF or AIFF format. * * @param audioData - The audio data. * @param format - The audio data format, not specified means 'Auto'. */ constructor(audioData: Uint8Array, format?: AudioFormat); /** * Gets a Uint8Array object containing the audio data. */ getAudioData(): Uint8Array | null; /** * Sets the audio data. */ setAudioData(data: Uint8Array | null): void; /** * Gets or sets the sampling rate, in samples per second. */ get samplingRate(): number; /** * Gets or sets the sampling rate, in samples per second. */ set samplingRate(value: number); /** * Gets or sets the number of sound channels. */ get soundChannels(): number; /** * Gets or sets the number of sound channels. */ set soundChannels(value: number); /** * Gets or sets the number of bits per sample value per channel. */ get bitsPerSample(): number; /** * Gets or sets the number of bits per sample value per channel. */ set bitsPerSample(value: number); /** * Gets or sets the encoding format for the sample data, one of: * "Raw", "Signed", "muLaw" or "ALaw". */ get encodingFormat(): string; /** * Gets or sets the encoding format for the sample data, one of: * "Raw", "Signed", "muLaw" or "ALaw". */ set encodingFormat(value: string); }