{"id":15043638,"url":"https://github.com/roccomuso/node-aplay","last_synced_at":"2025-08-12T05:14:50.700Z","repository":{"id":50216956,"uuid":"58754199","full_name":"roccomuso/node-aplay","owner":"roccomuso","description":":musical_note: ALSA aplay wrapper for Node.js","archived":false,"fork":false,"pushed_at":"2021-06-07T19:02:23.000Z","size":8,"stargazers_count":31,"open_issues_count":6,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T00:32:29.229Z","etag":null,"topics":["alsa","aplay","audio","node","raspberry-pi","wrapper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roccomuso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-13T16:03:29.000Z","updated_at":"2024-12-11T13:15:11.000Z","dependencies_parsed_at":"2022-09-26T20:52:39.007Z","dependency_job_id":null,"html_url":"https://github.com/roccomuso/node-aplay","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/roccomuso/node-aplay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnode-aplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnode-aplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnode-aplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnode-aplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roccomuso","download_url":"https://codeload.github.com/roccomuso/node-aplay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnode-aplay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269518414,"owners_count":24430622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alsa","aplay","audio","node","raspberry-pi","wrapper"],"created_at":"2024-09-24T20:49:22.144Z","updated_at":"2025-08-12T05:14:50.678Z","avatar_url":"https://github.com/roccomuso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aplay\n\n[![NPM Version](https://img.shields.io/npm/v/aplay.svg)](https://www.npmjs.com/package/aplay) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\u003e ALSA aplay wrapper for Node.js. It provides basic audio capabilities.\n\n`aplay` works on:\n  1. any Debian/Ubuntu system providing ALSA support has been installed.\n  2. MAC OSX (comes with `afplay` by default)\n\nALSA stands for Advanced Linux Sound Architecture. It is a suite of hardware drivers, libraries and utilities which provide audio and MIDI functionality for the Linux operating system.\n\n**aplay is a simple native ALSA wav player** (to reproduce .mp3 see *mpg321*).\n\n## Installation\n\n### Debian/Ubuntu/Raspbian\n\nGet ready.\nBefore we start the real work, please update the system.\n\n    sudo apt-get update\n    sudo apt-get upgrade\n\nIf you are running on Raspberry Pi, please update Raspbian\n\n    sudo rpi-update\n\nInstall ALSA for audio playback\n\n    sudo apt-get install alsa-base alsa-utils\n\n### USB Audio on Raspberry Pi\n\nIf you are planning on using a USB audio on Raspberry Pi you will need to set your USB audio device as the default device.\n\nEdit /etc/modprobe.d/alsa-base.conf and replaced the line:\n\n    options snd-usb-audio index=-2\n\nWith the following lines:\n\n    options snd-usb-audio index=0 nrpacks=1\n    options snd-bcm2835 index=-2\n\nAfter a reboot of your Raspberry Pi\n\n    aplay -l\n\nShould output the following:\n\n    **** List of PLAYBACK Hardware Devices ****\n    card 0: XXXX [XXXX], device 0: USB Audio [USB Audio]\n    Subdevices: 1/1\n    Subdevice #0: subdevice #0\n\nYour device volume will be set to 0 by default. Use the ALSA mixer to adjust the volume using your arrow keys:\n\n    alsamixer\n\n### Example Usage\n\nGet it through npm:\n\n    $ npm install aplay --save\n\nand then:\n\n```javascript\n\nvar Sound = require('aplay');\n\n// fire and forget:\nnew Sound().play('/path/to/the/file/filename.wav');\n\n// with ability to pause/resume:\nvar music = new Sound();\nmusic.play('/path/to/the/file/filename.wav');\n\nsetTimeout(function () {\n\tmusic.pause(); // pause the music after five seconds\n}, 5000);\n\nsetTimeout(function () {\n  music.resume(); // and resume it two seconds after pausing\n}, 7000);\n\n// you can also listen for various callbacks:\nmusic.on('complete', function () {\n  console.log('Done with playback!');\n});\n\n```\n\n## Options\n\nThe constructor accepts a config object where you can provide:\n\n- `channel`: specify a channel.\n\n### CLI Usage\n\n    $ node node_modules/aplay my-song.wav\n\n\nIt's simple as that.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Fnode-aplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froccomuso%2Fnode-aplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Fnode-aplay/lists"}