1.0.0 • Published 6 years ago

@scottishcyclops/node-player v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

node-player

Higher level abstraction on top of libgroove for node. Essentially a simple music player

Usage

const player = require("node-player")

const musics = [ "/home/me/Music/a.ogg", "/home/me/Music/b.wav" ]

async function main()
{
    // start playing the musics, shuffled
    await player.start(musics, true)

    // skip the music every 5 secondes
    setInterval(player.next, 5000)

    // stop it after 20 secondes
    setTimeout(player.stop, 20000)
}

main().catch(console.error)

Functions

More documentation is visible when calling the functions

start: play the given musics, possibly shuffled

stop: stop the playback

pause: pause the playback

resume: resume the playback

next: skip the current music in the playlist

getCurrentMusicInfos: get infos about the music playing

setGain: set the volume gain between 0 and 1

isPaused: is the playback paused

isPlaying: is anything in the playlist

End

Please report any bugs or feature request on Github