Windows build
This commit is contained in:
+3
-4
@@ -5,9 +5,9 @@
|
||||
// client/native/web_audio.ts), each of its sources an openal source. openal mixes on a thread of its own, with hrtf
|
||||
// like browsers' panners, and linear distance falloff the same as a web audio panner's
|
||||
import type { AudioCommand, SourceSettings } from "../client/native/messages.ts";
|
||||
import { type LibraryFiles, open_library } from "./libraries.ts";
|
||||
|
||||
const LIBRARY =
|
||||
{ linux: "libopenal.so.1", windows: "OpenAL32.dll", darwin: "libopenal.1.dylib" }[Deno.build.os as string];
|
||||
const LIBRARY: LibraryFiles = { linux: "libopenal.so.1", windows: "OpenAL32.dll", darwin: "libopenal.1.dylib" };
|
||||
|
||||
const SYMBOLS = {
|
||||
alcOpenDevice: { parameters: ["pointer"], result: "pointer" },
|
||||
@@ -77,8 +77,7 @@ export class OpenAl {
|
||||
|
||||
// throws when there's no openal or no sound device
|
||||
constructor() {
|
||||
if (!LIBRARY) throw new Error(`There's no openal for ${Deno.build.os}`);
|
||||
this.#al = Deno.dlopen(LIBRARY, SYMBOLS).symbols;
|
||||
this.#al = open_library("openal", LIBRARY, SYMBOLS);
|
||||
const al = this.#al;
|
||||
const device = al.alcOpenDevice(null);
|
||||
if (!device) throw new Error("There's no sound device");
|
||||
|
||||
Reference in New Issue
Block a user