Files
livekit-3d/scripts/build-spatial-opus.ps1
arimius 909e51bc0a
Test / test (pull_request) Canceled after 0s
PR Slack Notifier / notify-devs (pull_request) Canceled after 0s
Add server-side spatial audio with HRTF, occlusion and adaptive quality
2026-10-05 17:29:30 +03:00

19 lines
1.0 KiB
PowerShell

# Copyright 2026 Sverse contributors. Licensed under the Apache License, Version 2.0.
[CmdletBinding()]
param([string]$Generator = 'Visual Studio 17 2022')
$ErrorActionPreference = 'Stop'
$spatialRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$spatialRuntime = Join-Path $spatialRoot '.spatial-runtime'
$spatialSource = Join-Path $spatialRuntime 'opus-src'
$spatialBuild = Join-Path $spatialRuntime 'opus-build'
New-Item -ItemType Directory -Path $spatialRuntime -Force | Out-Null
if (!(Test-Path -LiteralPath $spatialSource)) {
& git clone --depth 1 --branch v1.5.2 https://github.com/xiph/opus.git $spatialSource
if ($LASTEXITCODE -ne 0) { throw 'Opus clone failed' }
}
& cmake -S $spatialSource -B $spatialBuild -G $Generator -A x64 -DBUILD_SHARED_LIBS=ON -DOPUS_BUILD_TESTING=OFF -DOPUS_BUILD_PROGRAMS=OFF
if ($LASTEXITCODE -ne 0) { throw 'Opus configure failed' }
& cmake --build $spatialBuild --config Release --parallel
if ($LASTEXITCODE -ne 0) { throw 'Opus build failed' }
Write-Host "Library: $(Join-Path $spatialBuild 'Release\opus.dll')"