sfml.js
    Preparing search index...

    Class Sound

    播放内存中的短音效,持有 SoundBuffer 以保留样本存储。

    Hierarchy (View Summary)

    Index

    Constructors

    • 绑定音频缓冲区,或复制 Sound 的属性和缓冲区引用。

      Parameters

      • bufferOrSource:
            | Readonly<
                Pick<
                    SoundBuffer,
                    | typeof audioHandle
                    | "getSamples"
                    | "getSampleCount"
                    | "getSampleRate"
                    | "getChannelCount"
                    | "getChannelMap"
                    | "getDuration"
                    | "saveToFile",
                >,
            >
            | Sound

      Returns Sound

    Properties

    "[audioHandle]": AudioHandle<"source">
    times: BigInt64Array
    values: Float32Array
    Cone: typeof Cone = Cone

    方向锥配置类型。

    Status: typeof SoundStatus = SoundStatus

    播放状态枚举。

    Methods

    • 返回当前绑定缓冲区的只读引用。

      Returns Readonly

    • 替换并保留音频缓冲区引用,同时更新原生播放源。

      Parameters

      • buffer: Readonly

      Returns void