{"_id":"@bun-win32/dsound","_rev":"4-45144b0718f5f04a8dcaa796dd8926b6","name":"@bun-win32/dsound","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/dsound","version":"1.0.0","keywords":["bun","ffi","win32","windows","dsound","directsound","audio","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/dsound@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":"f6b5f443e251c30f198252d9b6d64d43a3cc7a88","tarball":"https://registry.npmjs.org/@bun-win32/dsound/-/dsound-1.0.0.tgz","fileCount":6,"integrity":"sha512-qTFDXO8nT0AzZ2cfLR6tKtbER09LzsUVGMA3nvMaxsCi/ZK0YgWxGY4avaX81Ea4Oj3FFe9dCev1SsAkSlU4+A==","signatures":[{"sig":"MEUCIQDZ+MFsC9TewSxPppJMLtnBbW6P/HFnLHHwGdBm2LYjmAIgafDvB5lgMb8sMJJkKc2E7R0ghwxiACYUKsYt3JTKhFU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15281},"main":"./index.ts","type":"module","module":"index.ts","shasum":"f6b5f443e251c30f198252d9b6d64d43a3cc7a88","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:dsound-tone-organ":"bun ./example/dsound-tone-organ.ts","example:dsound-device-report":"bun ./example/dsound-device-report.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-qTFDXO8nT0AzZ2cfLR6tKtbER09LzsUVGMA3nvMaxsCi/ZK0YgWxGY4avaX81Ea4Oj3FFe9dCev1SsAkSlU4+A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/dsound"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 DirectSound 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/dsound_1.0.0_1779077508560_0.2589870888090069","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/dsound","version":"1.0.1","keywords":["bun","ffi","win32","windows","dsound","directsound","audio","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/dsound@1.0.1","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":"a8a3a4036edf42081bec5133fe867bf3ebb8ed44","tarball":"https://registry.npmjs.org/@bun-win32/dsound/-/dsound-1.0.1.tgz","fileCount":6,"integrity":"sha512-vGXYc/V9eV+mmRIJeBY+gauaG6L1dA51GTI6DPIR7xoylIKEDNTJYFjMadmp64IrjlRSjw3tYxc2VxBkPIILFA==","signatures":[{"sig":"MEYCIQCJHkoxQyppCbtFBtNev832HgShQc/1QaDTeUPakGmWJAIhAM23Fj/KSTQuCZwcfvU+hWsAOj6AA5g46tupmPSCWeW2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15286},"main":"./index.ts","type":"module","module":"index.ts","shasum":"a8a3a4036edf42081bec5133fe867bf3ebb8ed44","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:dsound-tone-organ":"bun ./example/dsound-tone-organ.ts","example:dsound-device-report":"bun ./example/dsound-device-report.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-vGXYc/V9eV+mmRIJeBY+gauaG6L1dA51GTI6DPIR7xoylIKEDNTJYFjMadmp64IrjlRSjw3tYxc2VxBkPIILFA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/dsound"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 DirectSound bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@types/node":"^25.6.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/dsound_1.0.1_1781130822348_0.9316355163232197","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/dsound","version":"2.0.0","keywords":["bun","ffi","win32","windows","dsound","directsound","audio","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/dsound@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":"fb0e1991fbb80cd78be894afc348d6ec05b61ae1","tarball":"https://registry.npmjs.org/@bun-win32/dsound/-/dsound-2.0.0.tgz","fileCount":6,"integrity":"sha512-XvZ8Dc38Pw+93TTWWlqYJvxBZO9+OgEmPZHt2r9Cw0vdmezHUiUWdKc8IEBzmDYksYkS2b3BCLieEON2nfH/XQ==","signatures":[{"sig":"MEUCIQD02j+vjSKGJ6uhDgUfbpK1er/GprChZ79kSWQJujVZPwIgIwOfbzHH+aOCLSc0zi7HfTJ43diketfiVQ8qOHQRfEg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16580},"main":"./index.ts","type":"module","module":"index.ts","shasum":"fb0e1991fbb80cd78be894afc348d6ec05b61ae1","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:dsound-tone-organ":"bun ./example/dsound-tone-organ.ts","example:dsound-device-report":"bun ./example/dsound-device-report.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-XvZ8Dc38Pw+93TTWWlqYJvxBZO9+OgEmPZHt2r9Cw0vdmezHUiUWdKc8IEBzmDYksYkS2b3BCLieEON2nfH/XQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/dsound"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 DirectSound 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/dsound_2.0.0_1782435300255_0.9112641989179995","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 DirectSound 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/dsound","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/dsound"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","dsound","directsound","audio","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:dsound-device-report":"bun ./example/dsound-device-report.ts","example:dsound-tone-organ":"bun ./example/dsound-tone-organ.ts"},"_id":"@bun-win32/dsound@2.0.1","_integrity":"sha512-1eJWRAXoP0T4IEtSqRMvp21q7y4JO6dSQt/UaYT79qy5q1X7t3I0LQUvM9KW1g/UzTy8R0YjqzkE7Rr5GYkbJA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"04f588f8755b2c4646b5fb2ecae39ea4ccfddd98","dist":{"integrity":"sha512-1eJWRAXoP0T4IEtSqRMvp21q7y4JO6dSQt/UaYT79qy5q1X7t3I0LQUvM9KW1g/UzTy8R0YjqzkE7Rr5GYkbJA==","shasum":"04f588f8755b2c4646b5fb2ecae39ea4ccfddd98","tarball":"https://registry.npmjs.org/@bun-win32/dsound/-/dsound-2.0.1.tgz","fileCount":6,"unpackedSize":16580,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDp+bac/2o5Wr0MqvAr2LvD1KVyai9c+z2Ikv6Md7LgDQIhAOPsJBVjMP71kqDEX5vBj5qr6hcB/5serRfrDAHm8DuQ"}]},"_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/dsound_2.0.1_1782437760836_0.02986475717101289"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T04:11:48.347Z","modified":"2026-06-26T01:36:01.107Z","1.0.0":"2026-05-18T04:11:48.691Z","1.0.1":"2026-06-10T22:33:42.487Z","2.0.0":"2026-06-26T00:55:00.419Z","2.0.1":"2026-06-26T01:36:00.963Z"},"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","dsound","directsound","audio","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/dsound"},"description":"Zero-dependency, zero-overhead Win32 DirectSound bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/dsound\n\nZero-dependency, zero-overhead Win32 DirectSound bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/dsound` exposes the `dsound.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `DSound`, 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 `dsound.dll` (DirectSound — device/capture creation and enumeration, full-duplex, and default-device GUID resolution).\n- In-source docs in `structs/DSound.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`DSound.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/DSound.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/dsound\n```\n\n## Quick Start\n\n```ts\nimport DSound from '@bun-win32/dsound';\n\n// Open the default playback device → an IDirectSound8 COM interface pointer.\nconst ppDS8 = Buffer.alloc(8);\nconst hr = DSound.DirectSoundCreate8(null, ppDS8.ptr, null);\nif (hr !== 0) throw new Error(`DirectSoundCreate8 failed: 0x${(hr >>> 0).toString(16)}`);\n\nconst device = ppDS8.readBigUInt64LE(0);\nconsole.log(`IDirectSound8 @ 0x${device.toString(16)}`);\n// ... walk IDirectSound8::CreateSoundBuffer / SetCooperativeLevel / 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 synth: synthesizes PCM in JS, plays it through dsound.dll,\n# and paints a play-cursor-locked ANSI oscilloscope + VU meter\nbun run example:dsound-tone-organ\n\n# Full audio-endpoint diagnostic: every playback/capture driver,\n# default-device GUIDs, decoded DSCAPS, and speaker configuration\nbun run example:dsound-device-report\n```\n\n## Notes\n\n- Either rely on lazy binding or call `DSound.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"}