Skip to content

Capabilities

Use detectCapabilities() to check whether the current browser supports the features required by Three Steam Audio.

function detectCapabilities(): SteamAudioCapabilities

Returns an object describing runtime support:

webAssembly : booleanWebAssembly is available.

audioWorklet : booleanAudioWorkletNode is available.

crossOriginIsolated : boolean — the page is cross-origin isolated.

sharedArrayBuffer : booleanSharedArrayBuffer is available. This requires cross-origin isolation.

runtimeBaking : boolean — always false in this version.

gpuSimulation : boolean — always false in this version.

import {
const detectCapabilities: () => SteamAudioCapabilities
detectCapabilities
} from 'three-steam-audio'
const
const caps: SteamAudioCapabilities
caps
=
function detectCapabilities(): SteamAudioCapabilities
detectCapabilities
()
if (!
const caps: SteamAudioCapabilities
caps
.
SteamAudioCapabilities.webAssembly: boolean
webAssembly
|| !
const caps: SteamAudioCapabilities
caps
.
SteamAudioCapabilities.audioWorklet: boolean
audioWorklet
) {
var console: Console
console
.
Console.error(...data: any[]): void

The console.error() static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.

MDN Reference

error
('Three Steam Audio is not supported in this browser')
}
if (!
const caps: SteamAudioCapabilities
caps
.
SteamAudioCapabilities.sharedArrayBuffer: boolean
sharedArrayBuffer
) {
var console: Console
console
.
Console.warn(...data: any[]): void

The console.warn() static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.

MDN Reference

warn
('Control updates will use postMessage fallback')
}