@dcl/ecs
Version:
Decentraland ECS
29 lines (28 loc) • 1.34 kB
TypeScript
import { Entity, IEngine } from '../../engine';
import { LastWriteWinElementSetComponentDefinition } from '../../engine/component';
import { PBAudioSource } from '../generated/pb/decentraland/sdk/components/audio_source.gen';
/**
* @public
*/
export interface AudioSourceComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBAudioSource> {
/**
* @public
*
* Set playing=true the sound `$name`
* @param entity - entity with AudioSource component
* @param src - the path to the sound to play
* @param resetCursor - the sound starts at 0 or continues from the current cursor position
* @returns true in successful playing, false if it doesn't find the AudioSource component
*/
playSound(entity: Entity, src: string, resetCursor?: boolean): boolean;
/**
* @public
*
* Set playing=false all sounds
* @param entity - entity with AudioSource component
* @param resetCursor - the sound stops at 0 or at the current cursor position
* @returns true in successful stopping, false if it doesn't find the AudioSource component
*/
stopSound(entity: Entity, resetCursor?: boolean): boolean;
}
export declare function defineAudioSourceComponent(engine: Pick<IEngine, 'defineComponentFromSchema'>): AudioSourceComponentDefinitionExtended;