{"_id":"7lab_groove_test","_rev":"2-8331d63e13d57d277f8299c1f4afdaa1","name":"7lab_groove_test","description":"bindings to libgroove - generic music player library","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"7lab_groove_test","version":"1.0.0","description":"bindings to libgroove - generic music player library","main":"lib/index.js","author":{"name":"Andrew Kelley","email":"superjoe30@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/andrewrk/node-groove.git"},"scripts":{"test":"mocha --reporter spec","install":"node-gyp rebuild"},"license":"MIT","devDependencies":{"mocha":"~2.4.5","ncp":"~2.0.0","pend":"~1.2.0"},"dependencies":{"bindings":"~1.3","nan":"~2.2.0"},"gypfile":true,"bugs":{"url":"https://github.com/andrewrk/node-groove/issues"},"homepage":"https://github.com/andrewrk/node-groove","directories":{"example":"example","test":"test"},"gitHead":"a74af62120e64128e14402d69e2e5a1c21d34b52","_id":"7lab_groove_test@1.0.0","_shasum":"25396247f2ec1e2fc0de54764b8ea8834b6db8ff","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"theotheo","email":"theo@7lab.nl"},"dist":{"shasum":"25396247f2ec1e2fc0de54764b8ea8834b6db8ff","tarball":"https://registry.npmjs.org/7lab_groove_test/-/7lab_groove_test-1.0.0.tgz","integrity":"sha512-cFme2GHlY+YAkAONG6O2DRbKmd0qhhEzAODH09y4xNG6M+W2mvLcP3ccMqieWAIkyDxHe5Kr/KzTnUrZ9Onyjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBf3XdIXHM8+SGchTsAso44GC/e8dry2SMcxB+E+6THbAiEArbjYHCM5TZsB0ySbaQ5CpuFYMTYg5Ft05Rt2QJJF9VQ="}]},"maintainers":[{"name":"theotheo","email":"theo@7lab.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/7lab_groove_test-1.0.0.tgz_1504619637165_0.5172402278985828"}}},"readme":"# node-groove\r\n\r\nNode.js bindings to [libgroove](https://github.com/andrewrk/libgroove) -\r\ngeneric music player backend library.\r\n\r\nLive discussion in `#libgroove` on [freenode](https://freenode.net/).\r\n\r\nHere are the main interfaces. See API Documentation below for more details.\r\n\r\n * GrooveFile - represents an open audio file.\r\n * GroovePlaylist - put files in the playlist, and the playlist decodes the\r\n   files and fills up the attached sinks.\r\n * GroovePlayer - attach this sink to a playlist to play the decoded audio over\r\n   the system's speakers.\r\n * GrooveEncoder - attach this sink to a playlist to obtain encoded audio\r\n   buffers, such as an mp3 stream.\r\n * GrooveLoudnessDetector - attach this sink to a playlist to compute how loud\r\n   files sound to the human ear, along with the \"true peak\" value. You can use\r\n   this to implement ReplayGain.\r\n * GrooveFingerprinter - attach this sink to a playlist to compute an acoustid\r\n   fingerprint. This can be used to look up a file by its audio content and\r\n   figure out which tags should be applied.\r\n * GrooveWaveformBuilder - attach this sink to a playlist to compute a JSON\r\n   representation of an audio file. This can be used to display a visualization\r\n   of the audio file.\r\n\r\n## Usage\r\n\r\n1. Install libgroove to your system. libgroove is a set of 4 libraries;\r\n   node-groove depends on all of them. So for example on ubuntu, make sure to\r\n   install libgroove-dev, libgrooveplayer-dev, libgrooveloudness-dev, and\r\n   libgroovefingerprinter-dev.\r\n2. `npm install --save groove`\r\n\r\n### Versions\r\n\r\n * node-groove >=3.0.0 depends on libgroove >=5.0.0\r\n * node-groove >=2.4.0 <3.0.0 depends on libgroove >=4.3.0 <5.0.0\r\n * node-groove 2.3.4 depends on libgroove <4.3.0\r\n\r\nSee CHANGELOG.md for release notes and upgrade guide.\r\n\r\n### Get Metadata from File\r\n\r\n```js\r\nvar groove = require('groove');\r\n\r\ngroove.open(\"danse-macabre.ogg\", function(err, file) {\r\n  if (err) throw err;\r\n  console.log(file.metadata());\r\n  console.log(\"duration:\", file.duration());\r\n  file.close(function(err) {\r\n    if (err) throw err;\r\n  });\r\n});\r\n```\r\n\r\n#### More Examples\r\n\r\n * example/metadata.js - read or update metadata in a media file\r\n * example/playlist.js - play several files in a row and then exit\r\n * example/replaygain.js - compute replaygain values for media files\r\n * example/transcode.js - convert and splice several files together\r\n * example/fingerprint.js - create an acoustid fingerprint for media files\r\n * example/devices.js - list the playback devices on the system\r\n * example/waveform.js - calculate a waveformjs compatible representation of a media file\r\n\r\n## API Documentation\r\n\r\n### globals\r\n\r\n#### groove.setLogging(level)\r\n\r\n`level` can be:\r\n\r\n * `groove.LOG_QUIET`\r\n * `groove.LOG_ERROR`\r\n * `groove.LOG_WARNING`\r\n * `groove.LOG_INFO`\r\n\r\n#### groove.loudnessToReplayGain(loudness)\r\n\r\nConverts a loudness value which is in LUFS to the ReplayGain-suggested dB\r\nadjustment.\r\n\r\n#### groove.dBToFloat(dB)\r\n\r\nConverts dB format volume adjustment to a floating point gain format.\r\n\r\n#### groove.getVersion()\r\n\r\nReturns an object with these properties:\r\n\r\n * `major`\r\n * `minor`\r\n * `patch`\r\n\r\n### GrooveFile\r\n\r\n#### groove.open(filename, callback)\r\n\r\n`callback(err, file)`\r\n\r\n#### file.close(callback)\r\n\r\n`callback(err)`\r\n\r\n#### file.duration()\r\n\r\nIn seconds.\r\n\r\n#### file.shortNames()\r\n\r\nA comma-separated list of short names for the format.\r\n\r\n#### file.getMetadata(key, [flags])\r\n\r\nFlags:\r\n\r\n * `groove.TAG_MATCH_CASE`\r\n * `groove.TAG_DONT_OVERWRITE`\r\n * `groove.TAG_APPEND`\r\n\r\n#### file.setMetadata(key, value, [flags])\r\n\r\nSee `getMetadata` for flags.\r\n\r\nPass `null` for `value` to delete a key.\r\n\r\n#### file.metadata()\r\n\r\nThis returns an object populated with all the metadata.\r\nUpdating the object does nothing. Use `setMetadata` to\r\nupdate metadata and then `save` to write changes to disk.\r\n\r\n#### file.dirty\r\n\r\nBoolean whether `save` will do anything.\r\n\r\n#### file.filename\r\n\r\nThe string that was passed to `groove.open`\r\n\r\n#### file.overrideDuration(duration)\r\n\r\nIf you know for sure the actual duration of the file, call this function\r\nto set the actual duration in seconds of the file. `GrooveWaveformBuilder`\r\nwill use this value instead of `file.duration()`.\r\n\r\nThis must only be called when no `GroovePlaylistItem` references to this file.\r\n\r\n#### file.save(callback)\r\n\r\n`callback(err)`\r\n\r\n### GroovePlaylist\r\n\r\n#### groove.createPlaylist()\r\n\r\nA playlist managers keeping an audio buffer full. To send the buffer\r\nto your speakers, use `playlist.createPlayer()`.\r\n\r\nNote: you probably only want one playlist. In node-groove, a playlist is\r\na low-level audio processing concept, not to be confused with user-facing\r\nplaylists where users might add, remove, and re-order songs.\r\n\r\n#### playlist.destroy()\r\n\r\nWhen finished with your playlist you must destroy it.\r\n\r\n#### playlist.items()\r\n\r\nReturns a read-only array of playlist items.\r\nUse `playlist.insert` and `playlist.remove` to modify.\r\n\r\n`[playlistItem1, playlistItem2, ...]`\r\n\r\n#### playlist.play()\r\n\r\n#### playlist.pause()\r\n\r\n#### playlist.seek(playlistItem, position)\r\n\r\nSeek to `playlistItem`, `position` seconds into the song.\r\n\r\n#### playlist.insert(file, gain, peak, nextPlaylistItem)\r\n\r\nCreates a new playlist item with file and puts it in the playlist before\r\n`nextPlaylistItem`. If `nextPlaylistItem` is `null`, appends the new\r\nitem to the playlist.\r\n\r\n`gain` is a float format volume adjustment that applies only to this item.\r\ndefaults to 1.0\r\n\r\n`peak` is float format, see `item.peak`.\r\ndefaults to 1.0\r\n\r\nReturns the newly added playlist item.\r\n\r\nOnce you add a file to the playlist, you must not `file.close()` it until\r\nyou first remove it from the playlist.\r\n\r\n#### playlist.remove(playlistItem)\r\n\r\nRemove `playlistItem` from the playlist.\r\n\r\nNote that you are responsible for calling `file.close()` on every file\r\nthat you open with `groove.open`. `playlist.remove` will not close files.\r\n\r\n#### playlist.position()\r\n\r\nReturns `{item, pos}` where `item` is the playlist item currently being\r\ndecoded and `pos` is how many seconds into the song the decode head is.\r\n\r\nNote that typically you are more interested in the position of the play head,\r\nnot the decode head. Example methods which return the play head are\r\n`player.position()` and `encoder.position()`.\r\n\r\n#### playlist.playing()\r\n\r\nReturns `true` or `false`.\r\n\r\n#### playlist.clear()\r\n\r\nRemove all playlist items.\r\n\r\n#### playlist.count()\r\n\r\nHow many items are on the playlist.\r\n\r\n#### playlist.gain\r\n\r\n#### playlist.setGain(value)\r\n\r\nBetween 0.0 and 1.0. You probably want to leave this at 1.0, since using\r\nreplaygain will typically lower your volume a significant amount.\r\n\r\n#### playlist.setItemGainPeak(playlistItem, gain, peak)\r\n\r\n`gain` is a float that affects the volume of the specified playlist item only.\r\nTo convert from dB to float, use exp(log(10) * 0.05 * dBValue).\r\n\r\nSee `item.peak`\r\n\r\n#### playlist.setFillMode(mode)\r\n\r\n`mode` can be:\r\n\r\n * `groove.EVERY_SINK_FULL`\r\n\r\n    The playlist will decode audio if any sinks are not full. If any sinks do\r\n    not drain fast enough the data will buffer up in the playlist.\r\n\r\n * `groove.ANY_SINK_FULL`\r\n\r\n    This is the default behavior. With this behavior, the playlist will stop\r\n    decoding audio when any attached sink is full, and then resume decoding\r\n    audio every sink is not full.\r\n\r\nDefaults to `groove.EVERY_SINK_FULL`.\r\n\r\n### GroovePlaylistItem\r\n\r\nThese are not instantiated directly; instead they are returned from\r\n`playlist.items()`.\r\n\r\nA `GroovePlaylistItem` is merely a pointer into a `GroovePlaylist`. If you\r\nremove a playlist item from a playlist, any playlist item references you\r\nhave lying around become dangling pointers.\r\n\r\n#### item.file\r\n\r\nRead-only.\r\n\r\n#### item.gain\r\n\r\nA volume adjustment in float format to apply to the file when it plays.\r\nThis is typically used for loudness compensation, for example ReplayGain.\r\nTo convert from dB to float, use `groove.dBToFloat`\r\n\r\nRead-only. Use `playlist.setItemGain` to modify.\r\n\r\n#### item.peak\r\n\r\nThe sample peak of this playlist item is assumed to be 1.0 in float\r\nformat. If you know for certain that the peak is less than 1.0, you\r\nmay set this value which may allow the volume adjustment to use\r\na pure amplifier rather than a compressor. This results in slightly\r\nbetter audio quality.\r\n\r\nRead-only. Use `playlist.setItemPeak` to modify.\r\n\r\n#### item.id\r\n\r\nEvery time you obtain a playlist item from groove, you will get a fresh\r\nJavaScript object, but it might point to the same underlying libgroove pointer\r\nas another. The `id` field is a way to check if two playlist items reference\r\nthe same one.\r\n\r\nRead-only.\r\n\r\n### GroovePlayer\r\n\r\n#### groove.getDevices()\r\n\r\nBefore you can call this function, you must call\r\n`groove.connectSoundBackend()`.\r\n\r\nReturns an object like this:\r\n\r\n```js\r\n{\r\n  list: [\r\n    {\r\n      name: \"User-Friendly Device Name\",\r\n      id: \"unique device ID that persists across plugs and unplugs\",\r\n      isRaw: false, // true if this device would claim exclusive access\r\n      probeError: 3, // non zero if scanning this device did not work\r\n    },\r\n    //...\r\n  ],\r\n  defaultIndex: 0,\r\n}\r\n```\r\n\r\n#### groove.connectSoundBackend([backend])\r\n\r\n`backend` is optional. If left blank the best backend is automatically\r\nselected. Otherwise it can be one of these:\r\n\r\n * `groove.BACKEND_JACK`\r\n * `groove.BACKEND_PULSEAUDIO`\r\n * `groove.BACKEND_ALSA`\r\n * `groove.BACKEND_COREAUDIO`\r\n * `groove.BACKEND_WASAPI`\r\n * `groove.BACKEND_DUMMY`\r\n\r\n#### groove.disconnectSoundBackend()\r\n\r\n#### groove.createPlayer()\r\n\r\nCreates a GroovePlayer instance which you can then configure by setting\r\nproperties.\r\n\r\n#### player.device\r\n\r\nBefore calling `attach()`, set this to one of the devices\r\nreturned from `groove.getDevices()`.\r\n\r\n#### player.attach(playlist, callback)\r\n\r\nSends audio to sound device.\r\n\r\n`callback(err)`\r\n\r\n#### player.detach(callback)\r\n\r\n`callback(err)`\r\n\r\n#### player.position()\r\n\r\nReturns `{item, pos}` where `item` is the playlist item currently being\r\nplayed and `pos` is how many seconds into the song the play head is.\r\n\r\n#### player.on('nowplaying', handler)\r\n\r\nFires when the item that is now playing changes. It can be `null`.\r\n\r\n`handler()`\r\n\r\n#### player.on('bufferunderrun', handler)\r\n\r\nFires when a buffer underrun occurs. Ideally you'll never see this.\r\n\r\n`handler()`\r\n\r\n#### player.on('devicereopened', handler)\r\n\r\nFires when you have set `useExactAudioFormat` to `true` and the audio device\r\nhas been closed and re-opened to match incoming audio data.\r\n\r\n`handler()`\r\n\r\n### GrooveEncoder\r\n\r\n#### groove.createEncoder()\r\n\r\n#### encoder.bitRate\r\n\r\nselect encoding quality by choosing a target bit rate\r\n\r\n#### encoder.formatShortName\r\n\r\noptional - help libgroove guess which format to use.\r\n`avconv -formats` to get a list of possibilities.\r\n\r\n#### encoder.codecShortName\r\n\r\noptional - help libgroove guess which codec to use.\r\n`avconv-codecs` to get a list of possibilities.\r\n\r\n#### encoder.filename\r\n\r\noptional - provide an example filename to help libgroove guess\r\nwhich format/codec to use.\r\n\r\n#### encoder.mimeType\r\n\r\noptional - provide a mime type string to help libgrooove guess\r\nwhich format/codec to use.\r\n\r\n#### encoder.targetAudioFormat\r\n\r\nThe desired audio format settings with which to encode.\r\n`groove.createEncoder()` defaults these to 44100 Hz,\r\nsigned 16-bit int, stereo.\r\nThese are preferences; if a setting cannot be used, a substitute will\r\nbe used instead. In this case, actualAudioFormat will be updated to reflect\r\nthe substituted values.\r\n\r\nProperties:\r\n\r\n * `sampleRate`\r\n * `channelLayout` - array of channel ids\r\n * `sampleFormat`\r\n\r\n#### encoder.actualAudioFormat\r\n\r\ngroove sets this to the actual format you get when you attach the encoder.\r\nIdeally will be the same as targetAudioFormat but might not be.\r\n\r\nProperties:\r\n\r\n * `sampleRate`\r\n * `channelLayout` - array of channel ids\r\n * `sampleFormat`\r\n\r\n#### encoder.sinkBufferSize\r\n\r\nHow big the sink buffer should be, in sample frames.\r\n`createEncoder` defaults this to 8192\r\n\r\n#### encoder.encodedBufferSize\r\n\r\nHow big the encoded audio buffer should be, in bytes.\r\n`createEncoder` defaults this to 16384\r\n\r\n#### encoder.attach(playlist, callback)\r\n\r\n`callback(err)`\r\n\r\n#### encoder.detach(callback)\r\n\r\n`callback(err)`\r\n\r\n#### encoder.getBuffer()\r\n\r\nReturns `null` if no buffer available, or an object with these properties:\r\n\r\n * `buffer` - a node `Buffer` instance which is the encoded data for this chunk\r\n   this can be `null` in which case this buffer is actually the end of\r\n   playlist sentinel.\r\n * `item` - the GroovePlaylistItem of which this buffer is encoded data for\r\n * `pos` - position in seconds that this buffer represents in into the item\r\n\r\n#### encoder.on('buffer', handler)\r\n\r\n`handler()`\r\n\r\nEmitted when there is a buffer available to get. You still need to get the\r\nbuffer with `getBuffer()`.\r\n\r\n#### encoder.position()\r\n\r\nReturns `{item, pos}` where `item` is the playlist item currently being\r\nencoded and `pos` is how many seconds into the song the encode head is.\r\n\r\n### GrooveLoudnessDetector\r\n\r\n#### groove.createLoudnessDetector()\r\n\r\nreturns a GrooveLoudnessDetector\r\n\r\n#### detector.infoQueueSize\r\n\r\nSet this to determine how far ahead into the playlist to look.\r\n\r\n#### detector.disableAlbum\r\n\r\nSet to `true` to only compute track loudness. This is faster and requires less\r\nmemory than computing both.\r\n\r\n#### detector.attach(playlist, callback)\r\n\r\n`callback(err)`\r\n\r\n#### detector.detach(callback)\r\n\r\n`callback(err)`\r\n\r\n#### detector.getInfo()\r\n\r\nReturns `null` if no info available, or an object with these properties:\r\n\r\n * `loudness` - loudness in LUFS\r\n * `peak` - sample peak in float format of the file\r\n * `duration` - duration in seconds of the track\r\n * `item` - the GroovePlaylistItem that this applies to, or `null` if it applies\r\n   to the entire album.\r\n\r\n#### detector.position()\r\n\r\nReturns `{item, pos}` where `item` is the playlist item currently being\r\ndetected and `pos` is how many seconds into the song the detect head is.\r\n\r\n#### detector.on('info', handler)\r\n\r\n`handler()`\r\n\r\nEmitted when there is info available to get. You still need to get the info\r\nwith `getInfo()`.\r\n\r\n### GrooveFingerprinter\r\n\r\n#### groove.createFingerprinter()\r\n\r\nreturns a GrooveFingerprinter\r\n\r\n#### groove.encodeFingerprint(rawFingerprint)\r\n\r\nGiven an Array of integers which is the raw fingerprint, encode it into a\r\nstring which can be submitted to acoustid.org.\r\n\r\n#### groove.decodeFingerprint(fingerprint)\r\n\r\nGiven the fingerprint string, returns a list of integers which is the raw\r\nfingerprint data.\r\n\r\n#### printer.infoQueueSize\r\n\r\nSet this to determine how far ahead into the playlist to look.\r\n\r\n#### printer.attach(playlist, callback)\r\n\r\n`callback(err)`\r\n\r\n#### printer.detach(callback)\r\n\r\n`callback(err)`\r\n\r\n#### printer.getInfo()\r\n\r\nReturns `null` if no info available, or an object with these properties:\r\n\r\n * `fingerprint` - integer array which is the raw fingerprint\r\n * `duration` - duration in seconds of the track\r\n * `item` - the GroovePlaylistItem that this applies to, or `null` if it applies\r\n   to the entire album.\r\n\r\n#### printer.position()\r\n\r\nReturns `{item, pos}` where `item` is the playlist item currently being\r\nfingerprinted and `pos` is how many seconds into the song the printer head is.\r\n\r\n#### printer.on('info', handler)\r\n\r\n`handler()`\r\n\r\nEmitted when there is info available to get. You still need to get the info\r\nwith `getInfo()`.\r\n\r\n### GrooveWaveformBuilder\r\n\r\n#### groove.createWaveformBuilder()\r\n\r\nreturns a GrooveWaveformBuilder\r\n\r\n#### waveform.widthInFrames\r\n\r\nHow many frames wide the waveform data will be. Defaults to 1920.\r\n\r\nIf you have a song with 100 frames and `widthInFrames` is 50, then each\r\nwaveform data frame will correspond to 2 frames of the original song.\r\n\r\n#### printer.infoQueueSizeBytes\r\n\r\nSet this to determine how far ahead into the playlist to look.\r\n\r\n#### waveform.attach(playlist, callback)\r\n\r\n`callback(err)`\r\n\r\n#### waveform.detach(callback)\r\n\r\n`callback(err)`\r\n\r\n#### waveform.getInfo()\r\n\r\nReturns `null` if no info available, or an object with these properties:\r\n\r\n * `buffer` - A `Buffer` of the waveform data, one unsigned 8 bit integer per\r\n   `widthInFrames`.\r\n * `expectedDuration` - This is the duration in seconds that was used to create\r\n   the waveform data. If this is different than `actualDuration` then the data\r\n   is invalid and must be re-calculated, this time using `file.overrideDuration()`\r\n * `actualDuration` - This is the correct duration in seconds for the track,\r\n   known only after waveform calculation is complete.\r\n * `item` - the GroovePlaylistItem that this applies to, or `null` if this info\r\n   signals the end of playlist.\r\n\r\n#### waveform.position()\r\n\r\nReturns `{item, pos}` where `item` is the playlist item currently being\r\ncalculated and `pos` is how many seconds into the song the waveform head is.\r\n\r\n#### waveform.on('info', handler)\r\n\r\n`handler()`\r\n\r\nEmitted when there is info available to get. You still need to get the info\r\nwith `getInfo()`.\r\n","maintainers":[{"name":"theotheo","email":"theo@7lab.nl"}],"time":{"modified":"2022-06-12T14:08:36.911Z","created":"2017-09-05T13:53:58.510Z","1.0.0":"2017-09-05T13:53:58.510Z"},"homepage":"https://github.com/andrewrk/node-groove","repository":{"type":"git","url":"git+https://github.com/andrewrk/node-groove.git"},"author":{"name":"Andrew Kelley","email":"superjoe30@gmail.com"},"bugs":{"url":"https://github.com/andrewrk/node-groove/issues"},"license":"MIT","readmeFilename":"README.md"}