{"_id":"@bun-win32/xaudio2_9","_rev":"3-4496c0f5e846fab8422fb52794148a9f","name":"@bun-win32/xaudio2_9","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/xaudio2_9","version":"1.0.0","keywords":["bun","ffi","win32","windows","xaudio2_9","xaudio2","x3daudio","audio","synthesis","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/xaudio2_9@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"1e5ffd092ba5f3fd192184adb5bd648e42bcf03f","tarball":"https://registry.npmjs.org/@bun-win32/xaudio2_9/-/xaudio2_9-1.0.0.tgz","fileCount":6,"integrity":"sha512-Ythyeqkl1F8dyhqtI2Cmafnk6jYdOvPeUbL/5KhNB4ogD3mnwS3dqr59v3SdEWrZUrJB9e1pmW09t1YMkc6IaA==","signatures":[{"sig":"MEQCIBmkRXUxRQZ+v3455OOsfC9gyAg8sOKpyhpgvbaOHyIpAiAnyr1sdbZ5SjdGJ641Yimxh1a219qyEHdWM42u3oqOMg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12852},"main":"./index.ts","type":"module","module":"index.ts","shasum":"1e5ffd092ba5f3fd192184adb5bd648e42bcf03f","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:xaudio2_9-fm-synth":"bun ./example/xaudio2_9-fm-synth.ts","example:xaudio2_9-engine-report":"bun ./example/xaudio2_9-engine-report.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-Ythyeqkl1F8dyhqtI2Cmafnk6jYdOvPeUbL/5KhNB4ogD3mnwS3dqr59v3SdEWrZUrJB9e1pmW09t1YMkc6IaA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/xaudio2_9"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 XAudio2 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@types/node":"^25.6.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/xaudio2_9_1.0.0_1779150550604_0.19777044506313435","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/xaudio2_9","version":"2.0.0","keywords":["bun","ffi","win32","windows","xaudio2_9","xaudio2","x3daudio","audio","synthesis","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/xaudio2_9@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"17029f70f94ba51610990eb9b74866bd7edb1d6f","tarball":"https://registry.npmjs.org/@bun-win32/xaudio2_9/-/xaudio2_9-2.0.0.tgz","fileCount":6,"integrity":"sha512-x+Qic4hIjugMNM9RfxUqNGkJKpb2GhtO0hOhRxkhsf/zIFqtQzJs6mr3FC8f6LgY9VQt+TgM7VbYBIIFTNlN2Q==","signatures":[{"sig":"MEUCIELwtBC+uoqSID6aRdaYI7A9KfjaL0qmnjB3TG4AsHKfAiEAy/T2p6mtKq3ge3/2vpwh5e7R834D2DHemkbXV0GLh30=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14168},"main":"./index.ts","type":"module","module":"index.ts","shasum":"17029f70f94ba51610990eb9b74866bd7edb1d6f","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:xaudio2_9-fm-synth":"bun ./example/xaudio2_9-fm-synth.ts","example:xaudio2_9-engine-report":"bun ./example/xaudio2_9-engine-report.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-x+Qic4hIjugMNM9RfxUqNGkJKpb2GhtO0hOhRxkhsf/zIFqtQzJs6mr3FC8f6LgY9VQt+TgM7VbYBIIFTNlN2Q==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/xaudio2_9"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 XAudio2 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@types/node":"^25.6.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/xaudio2_9_2.0.0_1782436010884_0.6897289738184142","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 XAudio2 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest","@types/node":"^25.6.0"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/xaudio2_9","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/xaudio2_9"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","xaudio2_9","xaudio2","x3daudio","audio","synthesis","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:xaudio2_9-engine-report":"bun ./example/xaudio2_9-engine-report.ts","example:xaudio2_9-fm-synth":"bun ./example/xaudio2_9-fm-synth.ts"},"_id":"@bun-win32/xaudio2_9@2.0.1","_integrity":"sha512-D8/wawUego943qzExDnG9LTwqMR0w5ydZqHRC91Wr7S8So9v03be56k6hSg4txVVay09d/l6mq6WOXeovf4g9w==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"80acb7b08793b0fd60c7b1d2372ab12d1028d6b2","dist":{"integrity":"sha512-D8/wawUego943qzExDnG9LTwqMR0w5ydZqHRC91Wr7S8So9v03be56k6hSg4txVVay09d/l6mq6WOXeovf4g9w==","shasum":"80acb7b08793b0fd60c7b1d2372ab12d1028d6b2","tarball":"https://registry.npmjs.org/@bun-win32/xaudio2_9/-/xaudio2_9-2.0.1.tgz","fileCount":6,"unpackedSize":14168,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICbV6DESAcPeFYFr2xllFRWAO6Nv/9VB/Ivr3xwbqoPaAiEA2EV3dk5SjyO9Mqzbon27MHukJOZO2t1AfNQdUqEwDfc="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/xaudio2_9_2.0.1_1782438235993_0.41127555560177087"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T00:29:10.490Z","modified":"2026-06-26T01:43:56.249Z","1.0.0":"2026-05-19T00:29:10.790Z","2.0.0":"2026-06-26T01:06:51.009Z","2.0.1":"2026-06-26T01:43:56.132Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","xaudio2_9","xaudio2","x3daudio","audio","synthesis","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/xaudio2_9"},"description":"Zero-dependency, zero-overhead Win32 XAudio2 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/xaudio2_9\n\nZero-dependency, zero-overhead Win32 XAudio2 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/xaudio2_9` exposes the `xaudio2_9.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Xaudio2_9`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `xaudio2_9.dll` (XAudio2 — low-latency audio engine creation, X3DAudio positional-audio math, and built-in XAPO effect instantiation).\n- In-source docs in `structs/Xaudio2_9.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Xaudio2_9.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Xaudio2_9.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/xaudio2_9\n```\n\n## Quick Start\n\n```ts\nimport Xaudio2_9, { S_OK, XAUDIO2_USE_DEFAULT_PROCESSOR } from '@bun-win32/xaudio2_9';\n\n// Boot a real XAudio2 engine → an IXAudio2 COM interface pointer.\nconst ppXAudio2 = Buffer.alloc(8);\nconst hr = Xaudio2_9.XAudio2Create(ppXAudio2.ptr!, 0, XAUDIO2_USE_DEFAULT_PROCESSOR);\nif (hr !== S_OK) throw new Error(`XAudio2Create failed: 0x${(hr >>> 0).toString(16)}`);\n\nconst engine = ppXAudio2.readBigUInt64LE(0);\nconsole.log(`IXAudio2 @ 0x${engine.toString(16)}`);\n// ... walk IXAudio2::CreateMasteringVoice / CreateSourceVoice / Release via the COM vtable.\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\n# A real FM synth: synthesizes PCM in JS, plays a melody through an\n# IXAudio2 mastering + source voice, and paints a play-locked ANSI scope\nbun run example:xaudio2_9-fm-synth\n\n# Full XAudio2 engine diagnostic: device details, performance counters,\n# debug mask, X3DAudio listener/emitter solve, and every built-in XAPO\nbun run example:xaudio2_9-engine-report\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Xaudio2_9.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}