KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
afplay
★ 14
Open GitHub ↗
Apple Audio File Play wrapper for Node.js
Download README (.md)
Explore Similar Repositories
khotkeys
:
Trigger actions when certain keys are pressed
hapi-harvester
:
A JSONAPI 1.0 plugin for Hapi.
shorturl.cr
:
A tiny library to use URL shortening services
Tube-DL
:
Download videos from many of the most popular video streaming sites
IoT
:
IoT Devices and Sensors is a collection of libraries for Windows 10 IoT Core.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
afplay
?
Download (.md)
<p align="center"> <img src="https://cdn.rawgit.com/sqmk/afplay/df76b14734220405722158231e4578c209bbab63/media/logo.svg" alt="Afplay" /> </p> # Afplay - Apple Audio File Play wrapper for Node.js [](https://www.npmjs.com/package/afplay) [](https://travis-ci.org/sqmk/afplay) [](https://david-dm.org/sqmk/afplay) Afplay is a wrapper for Apple Audio File Play (afplay). Use Afplay to play audio files on OS X via afplay. Afplay afplay! ## Installation Afplay was written for **Node.js 4+**. `npm install --save afplay` ## Usage Afplay is super simple to use! ### Play a Local File ```js let Afplay = require('afplay'); // Instantiate a new player let player = new Afplay; // Play a sound, handle result within a Promise player.play('/tmp/my-file.mp3') .then(() => { console.log('Audio done playing'); }) .catch(error => { console.log('Error playing file'); }); ``` ### Configure Volume & Play Time It is possible to configure volume and play time (in seconds). ```js player.play('/tmp/my-file.mp3', {volume: 100, time: 15}) .then(() => { console.log('Loud, short duration audio done playing'); }) .catch(error => { console.log('Error playing file'); }); ``` ## Examples View the [examples](examples) directory. ## Logo Afplay's initial logo was designed by scorpion6 on Fiverr. Font used is Lato Black. ## License This software is licensed under the MIT License. [View the license](LICENSE). Copyright © 2015 [Michael K. Squires](http://sqmk.com)