import { b as FlowGraphExecutionBlockWithOutSignal } from './KHR_interactivity-VqtS29i9.esm.js';
import { R as RichTypeAny, f as RichTypeNumber } from './declarationMapper-CZ6AxirO.esm.js';
import { f as RegisterClass } from './index-Cl9U4nB-.esm.js';
import './objectModelMapping-ghOGfUOh.esm.js';

/**
 * @experimental
 * A block that sets the volume of an Audio V2 sound.
 */
class FlowGraphSetSoundVolumeBlock extends FlowGraphExecutionBlockWithOutSignal {
    /**
     * Constructs a new FlowGraphSetSoundVolumeBlock.
     * @param config - optional configuration for the block
     */
    constructor(config) {
        super(config);
        this.sound = this.registerDataInput("sound", RichTypeAny);
        this.volume = this.registerDataInput("volume", RichTypeNumber, 1);
    }
    /**
     * @internal
     */
    _execute(context, _callingSignal) {
        const soundValue = this.sound.getValue(context);
        if (!soundValue) {
            this._reportError(context, "No sound provided");
            this.out._activateSignal(context);
            return;
        }
        const vol = this.volume.getValue(context);
        soundValue.volume = vol;
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FlowGraphSetSoundVolumeBlock" /* FlowGraphBlockNames.AudioSetVolume */;
    }
}
RegisterClass("FlowGraphSetSoundVolumeBlock" /* FlowGraphBlockNames.AudioSetVolume */, FlowGraphSetSoundVolumeBlock);

export { FlowGraphSetSoundVolumeBlock };
//# sourceMappingURL=flowGraphSetSoundVolumeBlock-BOi5MXSP.esm.js.map
