{"_id":"@adhityan/speaker","_rev":"2-ec361ceee1f787560b2c9066c74492ef","name":"@adhityan/speaker","dist-tags":{"latest":"0.5.7"},"versions":{"0.5.5":{"name":"@adhityan/speaker","version":"0.5.5","keywords":["pcm","audio","sound","music","output","speaker","headphone","alsa","coreaudio","openal","sdl","portaudio","jack","oss","pulse","mpg123"],"author":{"name":"K V Adhityan"},"license":"(MIT AND LGPL-2.1-only)","_id":"@adhityan/speaker@0.5.5","maintainers":[{"name":"adhityan","email":"kvadhi@gmail.com"}],"homepage":"https://github.com/TooTallNate/node-speaker#readme","bugs":{"url":"https://github.com/TooTallNate/node-speaker/issues"},"dist":{"shasum":"c70ae58027d95c6b51e643cc45d764a85c7800b1","tarball":"https://registry.npmjs.org/@adhityan/speaker/-/speaker-0.5.5.tgz","fileCount":245,"integrity":"sha512-etzDHvl00P8JUGcTZsDMGRXC7LheB0l+Ht26qKcGvH5F9fG/mCfJSs+Q5rKTPrSQcizrTZDTIP45NrE9G1CCZA==","signatures":[{"sig":"MEUCIHEu+NeGmiy4O9cMKaLiH5K0JQCDggjLELn4wpLWHiflAiEAzcqaj/z8KyLTHg1kzoNDjHGdunWb3wR4VXaJY3wWBoc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3660566},"main":"index.js","types":"index.d.ts","engines":{"node":">=8.6"},"gitHead":"9339c52409b886f88ae1c3a83a451edbec021594","gypfile":true,"scripts":{"test":"standard && node-gyp rebuild --mpg123-backend=dummy","install":"node-gyp rebuild"},"_npmUser":{"name":"adhityan","email":"kvadhi@gmail.com"},"repository":{"url":"git+https://github.com/TooTallNate/node-speaker.git","type":"git"},"_npmVersion":"11.1.0","description":"Output PCM audio data to the speakers","directories":{},"_nodeVersion":"23.4.0","dependencies":{"debug":"^4.0.0","bindings":"^1.3.0","buffer-alloc":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^6.2.2","standard":"^14.3.1","@types/node":"^12.12.14"},"_npmOperationalInternal":{"tmp":"tmp/speaker_0.5.5_1741115813878_0.9843847702939403","host":"s3://npm-registry-packages-npm-production"}},"0.5.6":{"name":"@adhityan/speaker","version":"0.5.6","keywords":["pcm","audio","sound","music","output","speaker","headphone","alsa","coreaudio","openal","sdl","portaudio","jack","oss","pulse","mpg123"],"author":{"name":"K V Adhityan"},"license":"(MIT AND LGPL-2.1-only)","_id":"@adhityan/speaker@0.5.6","maintainers":[{"name":"adhityan","email":"kvadhi@gmail.com"}],"homepage":"https://github.com/TooTallNate/node-speaker#readme","bugs":{"url":"https://github.com/TooTallNate/node-speaker/issues"},"dist":{"shasum":"574ed954dc8a0831462121bca961cca427de736f","tarball":"https://registry.npmjs.org/@adhityan/speaker/-/speaker-0.5.6.tgz","fileCount":245,"integrity":"sha512-FB1UBBDIjn/nW4oXdfZ64uh+UAd5UBQ3xijGqQtT8W3vC0CZ6nB4LpjnjBqKCnhTvfb9kbnoIGiIQHX57MG6mQ==","signatures":[{"sig":"MEQCIDxzKbbhDvMExDPJAKCi8SdIS+LSxGR8QSNsVZ5VqkKmAiAso9clBsiK5HqZk+4KaqzTpzCgBwWOf5f0DBKANVSkww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3660463},"main":"index.js","types":"index.d.ts","engines":{"node":">=8.6"},"gitHead":"9339c52409b886f88ae1c3a83a451edbec021594","gypfile":true,"scripts":{"test":"standard && node-gyp rebuild --mpg123-backend=dummy","install":"node-gyp rebuild"},"_npmUser":{"name":"adhityan","email":"kvadhi@gmail.com"},"repository":{"url":"git+https://github.com/TooTallNate/node-speaker.git","type":"git"},"_npmVersion":"11.1.0","description":"Output PCM audio data to the speakers","directories":{},"_nodeVersion":"23.4.0","dependencies":{"debug":"^4.4.0","bindings":"^1.5.0","buffer-alloc":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^11.1.0","standard":"^17.1.2","@types/node":"^22.13.9"},"_npmOperationalInternal":{"tmp":"tmp/speaker_0.5.6_1741116053999_0.49606242790017285","host":"s3://npm-registry-packages-npm-production"}},"0.5.7":{"name":"@adhityan/speaker","version":"0.5.7","license":"(MIT AND LGPL-2.1-only)","description":"Output PCM audio data to the speakers","author":{"name":"K V Adhityan"},"repository":{"type":"git","url":"git+https://github.com/TooTallNate/node-speaker.git"},"main":"index.js","types":"index.d.ts","scripts":{"test":"standard && node-gyp rebuild --mpg123-backend=dummy","install":"node-gyp rebuild"},"dependencies":{"bindings":"^1.5.0","buffer-alloc":"^1.2.0","debug":"^4.4.0"},"devDependencies":{"@types/node":"^22.13.9","mocha":"^11.1.0","standard":"^17.1.2"},"engines":{"node":">=8.6"},"keywords":["pcm","audio","sound","music","output","speaker","headphone","alsa","coreaudio","openal","sdl","portaudio","jack","oss","pulse","mpg123"],"_id":"@adhityan/speaker@0.5.7","gypfile":true,"gitHead":"9339c52409b886f88ae1c3a83a451edbec021594","bugs":{"url":"https://github.com/TooTallNate/node-speaker/issues"},"homepage":"https://github.com/TooTallNate/node-speaker#readme","_nodeVersion":"23.4.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-L5AKsbWZEJivYtc4wMR96Ij4GJcxw1x66CJMk2McOwgUS1mZEczG6lccpz5+wERgzQAMZmdgOjer3yq6Qx/aUQ==","shasum":"672060a527dc7dc1e15de50ac46753d50b4b5d0c","tarball":"https://registry.npmjs.org/@adhityan/speaker/-/speaker-0.5.7.tgz","fileCount":245,"unpackedSize":3660466,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDEYX/GN6JGuzHVkD0nuIsF1GDdqJt3sQq+98iImgoKtAIhAIx2mAjsrIGIziF6nZ3Jmg9f+1R2P3+YBK0uSO57GtTc"}]},"_npmUser":{"name":"adhityan","email":"kvadhi@gmail.com"},"directories":{},"maintainers":[{"name":"adhityan","email":"kvadhi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/speaker_0.5.7_1741116660172_0.06975118756918408"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-04T19:16:53.781Z","modified":"2025-03-04T19:31:00.673Z","0.5.5":"2025-03-04T19:16:54.146Z","0.5.6":"2025-03-04T19:20:54.284Z","0.5.7":"2025-03-04T19:31:00.527Z"},"bugs":{"url":"https://github.com/TooTallNate/node-speaker/issues"},"author":{"name":"K V Adhityan"},"license":"(MIT AND LGPL-2.1-only)","homepage":"https://github.com/TooTallNate/node-speaker#readme","keywords":["pcm","audio","sound","music","output","speaker","headphone","alsa","coreaudio","openal","sdl","portaudio","jack","oss","pulse","mpg123"],"repository":{"type":"git","url":"git+https://github.com/TooTallNate/node-speaker.git"},"description":"Output PCM audio data to the speakers","maintainers":[{"name":"adhityan","email":"kvadhi@gmail.com"}],"readme":"# node-speaker\n\nThis is a fork of the node speaker library with some fixes.\n\n## Output [PCM audio][pcm] data to the speakers\n\nA Writable stream instance that accepts [PCM audio][pcm] data and outputs it\nto the speakers. The output is backed by `mpg123`'s audio output modules, which\nin turn use any number of audio backends commonly found on Operating Systems\nthese days.\n\n## Installation\n\nSimply compile and install `node-speaker` using `npm`:\n\n```sh\nnpm install speaker\n```\n\nOn Debian/Ubuntu, the [ALSA][alsa] backend is selected by default, so be sure\nto have the `alsa.h` header file in place:\n\n```sh\nsudo apt-get install libasound2-dev\n```\n\n## Example\n\nHere's an example of piping `stdin` to the speaker, which should be 2 channel,\n16-bit audio at 44,100 samples per second (a.k.a CD quality audio).\n\n```javascript\nconst Speaker = require('speaker');\n\n// Create the Speaker instance\nconst speaker = new Speaker({\n  channels: 2,          // 2 channels\n  bitDepth: 16,         // 16-bit samples\n  sampleRate: 44100     // 44,100 Hz sample rate\n});\n\n// PCM data from stdin gets piped into the speaker\nprocess.stdin.pipe(speaker);\n```\n\n## API\n\n`require('speaker')` directly returns the `Speaker` constructor. It is the only\ninterface exported by `node-speaker`.\n\n### new Speaker([ options ]) -> Speaker instance\n\nCreates a new `Speaker` instance, which is a writable stream that you can pipe\nPCM audio data to. The optional `options` object may contain any of the `Writable`\nbase class options, as well as any of these PCM formatting options:\n\n* `channels` - The number of audio channels. PCM data must be interleaved. Defaults to `2`.\n* `bitDepth` - The number of bits per sample. Defaults to `16` (16-bit).\n* `sampleRate` - The number of samples per second per channel. Defaults to `44100`.\n* `signed` - Boolean specifying if the samples are signed or unsigned. Defaults to `true` when bit depth is 8-bit, `false` otherwise.\n* `float` - Boolean specifying if the samples are floating-point values. Defaults to `false`.\n* `samplesPerFrame` - The number of samples to send to the audio backend at a time. You likely don't need to mess with this value. Defaults to `1024`.\n* `device` - The name of the playback device. E.g. `'hw:0,0'` for first device of first sound card or `'hw:1,0'` for first device of second sound card. Defaults to `null` which will pick the default device.\n\n#### \"open\" event\n\nFired when the backend `open()` call has completed. This happens once the first\n`write()` call happens on the speaker instance.\n\n#### \"flush\" event\n\nFired after the speaker instance has had `end()` called, and after the audio data\nhas been flushed to the speakers.\n\n#### \"close\" event\n\nFired after the \"flush\" event, after the backend `close()` call has completed.\nThis speaker instance is essentially finished after this point.\n\n## Audio Backend Selection\n\n`node-speaker` is backed by `mpg123`'s \"output modules\", which in turn use one of\nmany popular audio backends like ALSA, OSS, SDL, and lots more. The default\nbackends for each operating system are described in the table below:\n\n| **Operating System** | **Audio Backend** | **Description**\n|:---------------------|:------------------|:----------------------------------\n| Linux                | `alsa`            | Output audio using [Advanced Linux Sound Architecture (ALSA)][alsa].\n| Mac OS X             | `coreaudio`       | Output audio using Mac OS X's CoreAudio.\n| Windows              | `win32`           | Audio output for Windows (winmm).\n| Solaris              | `sun`             | Audio output for Sun Audio.\n\nTo manually override the default backend, pass the `--mpg123-backend` switch to\n`npm`/`node-gyp`:\n\n```sh\nnpm install speaker --mpg123-backend=openal\n```\n\n[pcm]: http://en.wikipedia.org/wiki/Pulse-code_modulation\n[alsa]: http://www.alsa-project.org/\n","readmeFilename":"README.md"}