{"_id":"@bmat/wavesurfer.js","_rev":"3-2b3182e38221573ebe983a11370e468f","name":"@bmat/wavesurfer.js","dist-tags":{"latest":"1.0.24"},"versions":{"1.0.23":{"name":"@bmat/wavesurfer.js","version":"1.0.23","description":"BMAT fork of Interactive navigable audio visualization using Web Audio and Canvas","main":"dist/wavesurfer.cjs.js","directories":{"example":"example"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/katspaugh/wavesurfer.js.git"},"author":"","license":"CC-BY 3.0","bugs":{"url":"https://github.com/katspaugh/wavesurfer.js/issues"},"devDependencies":{"grunt":">=0.4.5","grunt-contrib-concat":">=0.4.0","grunt-contrib-uglify":">=0.5.0"},"homepage":"https://github.com/katspaugh/wavesurfer.js","gitHead":"8475fc09420a6eb71fe0b0e0d6ef6a8782bb5c43","_id":"@bmat/wavesurfer.js@1.0.23","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"dogmatico","email":"cristian.lorenzo.martinez@gmail.com"},"dist":{"integrity":"sha512-YFBpFI6emyIRKprZE4BkNsto1cobDB3bo2sLk8TpPC86cVwGMYlm9YLmHv5gO7dOn/MR9PafLbxMYjP6N8yfzg==","shasum":"b702da1c37713303f5e6fd8033e51d4d4b713eb4","tarball":"https://registry.npmjs.org/@bmat/wavesurfer.js/-/wavesurfer.js-1.0.23.tgz","fileCount":57,"unpackedSize":4910792,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyGJMtid5xSl5fnjrKsJFfcVt5EnAyGGK0aJo/neJePgIgIFR5HSJRVpSyZXsODSw+cgIZgAEKYdgFhZEGBXsxW80="}]},"maintainers":[{"name":"dogmatico","email":"cristian.lorenzo.martinez@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavesurfer.js_1.0.23_1519998756346_0.3640812921186731"},"_hasShrinkwrap":false},"1.0.24":{"name":"@bmat/wavesurfer.js","version":"1.0.24","description":"BMAT fork of Interactive navigable audio visualization using Web Audio and Canvas","main":"dist/wavesurfer.cjs.js","directories":{"example":"example"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/katspaugh/wavesurfer.js.git"},"author":"","license":"CC-BY 3.0","bugs":{"url":"https://github.com/katspaugh/wavesurfer.js/issues"},"devDependencies":{"grunt":">=0.4.5","grunt-contrib-concat":">=0.4.0","grunt-contrib-uglify":">=0.5.0"},"homepage":"https://github.com/katspaugh/wavesurfer.js","gitHead":"12b15049a1b15223b7092b61c619aba6ff048435","_id":"@bmat/wavesurfer.js@1.0.24","_npmVersion":"6.0.0","_nodeVersion":"8.11.1","_npmUser":{"name":"dogmatico","email":"cristian.lorenzo.martinez@gmail.com"},"dist":{"integrity":"sha512-fseg1ZpzFh/WmvTKMl0tFNZhYsCyfM/JMifPUeHLo0Dlin4NDX237z8t6g2ABys4Qek8/EYae++ExIQBmCRgkQ==","shasum":"f3d4c1831f0307e4bd154532dc44125f06e29efd","tarball":"https://registry.npmjs.org/@bmat/wavesurfer.js/-/wavesurfer.js-1.0.24.tgz","fileCount":57,"unpackedSize":4911376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8AZICRA9TVsSAnZWagAAqDwQAI1+BLFyrQ6aoVy5F6Ej\nFM8r8MbDWSspuASkrpq1SSdOeUhlWYyNA/bydZyFkqS6NayBMF4/TJmBA+Kp\npCkEYZxZ/oMATe46Bh77jbOVVQi647ZSdWHzbXL+LpG4DuZ7/nL1rhKQDaq3\nKXExjiWxOLM90JjboNaGO4jDjLuZMYWJrmiIoatAtXDC06Oj9GMtwSs79lLo\nc23JJPJwwPz+1z3kOiQc9Btzo6JG92/Zs0hnAWG3tWfc2/JPbV/Oxs8Qf3GV\nvQEq1wUO43WBysPbAC2fwmlqwTaPXW2yb10R5Mi/0F+oJ4Yzh67sa/zKBDo2\n3Ft50lT0YIXYFSx0BlaEIzqCOxYwSUEZferWCMD9TFMb8XVm+7c0/V+0nTe3\nqZYHR4mnQme3L+cI5/MMPDQbUlrKa77XklaCjMySfTJZi1mQCz0mdgdA5S6e\n5GBoUxQM/Sp+MwcsJf9bTDNzBQjjFpsVox3n9gecKzbiI/ZbYw+KaGCWQOxJ\nnP7JWALz4rMa7i7fbU1ISulZpKbbfP4GgBfBE6JHWvXqAaRvviuE5P9S3r0x\n12gobiC4raTbbRur2sH397aj8qKNAPTOBpNM+LslMMgT5908NB1EPZzhFKwC\nyaSHb05o4F9y/k4m4adYUJutEoN04+M2a5PzKaBkMLyxUUKwyHIFn1g8RG1w\nxqSh\r\n=dUC9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBBj5zkakxnbICAIo5pgP5zFMUxBNXuL1H23+gPhggPAiEA7OpCPwrIPxqL82wYwA9UQ9zsTBPomT7dD4xF0VxOj1Q="}]},"maintainers":[{"name":"dogmatico","email":"cristian.lorenzo.martinez@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wavesurfer.js_1.0.24_1525679687450_0.4127167750284384"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-02T13:52:36.292Z","1.0.23":"2018-03-02T13:52:36.553Z","modified":"2022-04-04T19:51:54.725Z","1.0.24":"2018-05-07T07:54:47.713Z"},"maintainers":[{"name":"dogmatico","email":"cristian.lorenzo.martinez@gmail.com"}],"description":"BMAT fork of Interactive navigable audio visualization using Web Audio and Canvas","homepage":"https://github.com/katspaugh/wavesurfer.js","repository":{"type":"git","url":"git://github.com/katspaugh/wavesurfer.js.git"},"bugs":{"url":"https://github.com/katspaugh/wavesurfer.js/issues"},"license":"CC-BY 3.0","readme":"# wavesurfer.js\n\nInteractive navigable audio visualization using\n[Web Audio](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html)\nand Canvas.\n\n![Screenshot](/example/screenshot.png?raw=true \"Screenshot\")\n\n### Browser support\nwavesurfer.js works only in modern browsers supporting Web Audio\n(Chrome, Firefox, Safari, Opera etc).\n\nIt will fallback to Audio Element in other browsers (without\ngraphics).  You can also try\n[wavesurfer.swf](https://github.com/laurentvd/wavesurfer.swf) which is\na Flash-based fallback with graphics.\n\n\n\n### API in examples\n\nCreate an instance:\n\n```javascript\nvar wavesurfer = Object.create(WaveSurfer);\n```\n\nInitialize it with a container element (plus some options):\n\n```javascript\nwavesurfer.init({\n    container: '#wave',\n    waveColor: 'violet',\n    progressColor: 'purple'\n});\n```\n\nSubscribe to some events:\n\n```javascript\nwavesurfer.on('ready', function () {\n    wavesurfer.play();\n});\n```\n\nLoad an audio file from a URL:\n\n```javascript\nwavesurfer.load('example/media/demo.wav');\n```\n\nSee the example code [here](/example/main.js).\n\n### WaveSurfer Options\n\n| option | type | default | description |\n| --- | --- | --- | --- |\n| `audioContext` | string | `null` | Use your own previously initialized `AudioContext` or leave blank. |\n| `audioRate` | float | `1` | Speed at which to play audio.  Lower number is slower. |\n| `backend` | string | `WebAudio` | `WebAudio` or `AudioElement`. In most cases you don't have to set this manually. `AudioElement` is a fallback for unsupported browsers. |\n| `container` | mixed | _none_ | CSS-selector or HTML-element where the waveform should be drawn. This is the only required parameter. |\n| `cursorColor` | string | `#333` | The fill color of the cursor indicating the playhead position. |\n| `cursorWidth` | integer | `1` | Measured in pixels. |\n| `fillParent` | boolean | `true` | Whether to fill the entire container or draw only according to `minPxPerSec`. |\n| `height` | integer | `128` | The height of the waveform.  Measured in pixels. |\n| `hideScrollbar` | boolean | `false` | Whether to hide the horizontal scrollbar when one would normally be shown. |\n| `interact` | boolean | `true` | Whether the mouse interaction will be enabled at initialization.  You can switch this parameter at any time later on. |\n| `minPxPerSec` | integer | `50` | Minimum number of pixels per second of audio. |\n| `pixelRatio` | integer | `window.devicePixelRatio` | Can be set to `1` for faster rendering. |\n| `progressColor` | string | `#555` | The fill color of the part of the waveform behind the cursor. |\n| `scrollParent` | boolean | `false` | Whether to scroll the container with a lengthy waveform. Otherwise the waveform is shrunk to the container width (see `fillParent`). |\n| `skipLength` | float | `2` | Number of seconds to skip with the `skipForward()` and `skipBackward()` methods. |\n| `waveColor` | string | `#999` | The fill color of the waveform after the cursor. |\n\n### WaveSurfer Methods\n\nAll methods are intentionally public, but the most readily available are the following:\n\n * `init(options)` – Initializes with the options listed above.\n * `destroy()` – Removes events, elements and disconnects Web Audio nodes.\n * `empty()` – Clears the waveform as if a zero-length audio is loaded.\n * `getCurrentTime()` – Returns current progress in seconds.\n * `getDuration()` – Returns the duration of an audio clip in seconds.\n * `load(url)` – Loads audio from URL via XHR. Returns XHR object.\n * `loadBlob(url)` – Loads audio from a `Blob` or `File` object.\n * `on(eventName, callback)` – Subscribes to an event.  See [WaveSurfer Events](#wavesurfer-events) section below for a list.\n * `un(eventName, callback)` – Unsubscribes from an event.\n * `unAll()` – Unsubscribes from all events.\n * `pause()` – Stops playback.\n * `play([start[, end]])` – Starts playback from the current position.  Optional `start` and `end` measured in seconds can be used to set the range of audio to play.\n * `playPause()` – Plays if paused, pauses if playing.\n * `seekAndCenter(progress)` – Seeks to a progress and centers view `[0..1]` (0 = beginning, 1 = end).\n * `seekTo(progress)` – Seeks to a progress `[0..1]` (0=beginning, 1=end).\n * `setFilter(filters)` - For inserting your own WebAudio nodes into the graph.  See [Connecting Filters](#connecting-filters) below.\n * `setPlaybackRate(rate)` – Sets the speed of playback (`0.5` is half speed, `1` is normal speed, `2` is double speed and so on).\n * `setVolume(newVolume)` – Sets the playback volume to a new value `[0..1]` (0 = silent, 1 = maximum).\n * `skip(offset)` – Skip a number of seconds from the current position (use a negative value to go backwards).\n * `skipBackward()` - Rewind `skipLength` seconds.\n * `skipForward()` - Skip ahead `skipLength` seconds.\n * `stop()` – Stops and goes to the beginning.\n * `toggleMute()` – Toggles the volume on and off.\n * `toggleInteraction()` – Toggle mouse interaction.\n * `toggleScroll()` – Toggles `scrollParent`.\n\n##### Connecting Filters\n\nYou can insert your own Web Audio nodes into the graph using the method `setFilter()`. Example:\n\n```javascript\nvar lowpass = wavesurfer.backend.ac.createBiquadFilter();\nwavesurfer.backend.setFilter(lowpass);\n```\n\n### WaveSurfer Events\n\nGeneral events:\n\n * `error` – Occurs on error.  Callback will receive (string) error message.\n * `finish` – When it finishes playing.\n * `loading` – Fires continuously when loading via XHR or drag'n'drop. Callback will receive (integer) loading progress in percents [0..100] and (object) event target.\n * `mouseup` - When a mouse button goes up.  Callback will receive `MouseEvent` object.\n * `pause` – When audio is paused.\n * `play` – When play starts.\n * `ready` – When audio is loaded, decoded and the waveform drawn.\n * `scroll` - When the scrollbar is moved.  Callback will receive a `ScrollEvent` object.\n * `seek` – On seeking.  Callback will receive (float) progress [0..1].\n\nRegion events (exposed by the Regions plugin):\n\n * `region-in` – When playback enters a region. Callback will receive the `Region` object.\n * `region-out`– When playback leaves a region. Callback will receive the `Region` object.\n * `region-mouseenter` - When the mouse moves over a region.  Callback will receive the `Region` object, and a `MouseEvent` object.\n * `region-mouseleave` - When the mouse leaves a region.  Callback will receive the `Region` object, and a `MouseEvent` object.\n * `region-click` - When the mouse clicks on a region.  Callback will receive the `Region` object, and a `MouseEvent` object.\n * `region-dblclick` - When the mouse double-clicks on a region.  Callback will receive the `Region` object, and a `MouseEvent` object.\n * `region-created` – When a region is created. Callback will receive the `Region` object.\n * `region-updated` – When a region is updated. Callback will receive the `Region` object.\n * `region-update-end` – When dragging or resizing is finished.\n * `region-removed` – When a region is removed. Callback will receive the `Region` object.\n\n\n## Regions Plugin\n\nRegions are visual overlays on waveform that can be used to play and\nloop portions of audio. Regions can be dragged and resized.\n\nVisual customization is possible via CSS (using the selectors\n`.wavesurfer-region` and `.wavesurfer-handle`).\n\nTo enable the plugin, add the script `plugin/wavesurfer.regions.js` to\nyour page.\n\nAfter doing that, use `wavesurfer.addRegion()` to create Region objects.\n\n#### Exposed Methods\n\n * `addRegion(options)` – Creates a region on the waveform. Returns a `Region` object.  See [Region Options](#region-options), [Region Methods](#region-methods) and [Region Events](#region-events) below.\n * `clearRegions()` – Removes all regions.\n * `enableDragSelection(options)` – Lets you create regions by selecting.\n   areas of the waveform with mouse. `options` are Region objects' params (see [below](#region-options)).\n\n### Region Options\n\n| option | type | default | description |\n| --- | --- | --- | --- |\n| `id` | string | random | The id of the region. |\n| `start` | float | `0` | The start position of the region (in seconds). |\n| `end` | float | `0` | The end position of the region (in seconds). |\n| `loop` | boolean | `false` | Whether to loop the region when played back. |\n| `drag` | boolean | `true` | Allow/dissallow dragging the region. |\n| `resize` | boolean | `true` | Allow/dissallow resizing the region. |\n| `color` | string | `\"rgba(0, 0, 0, 0.1)\"` | HTML color code. |\n\n### Region Methods\n\n * `remove()` - Remove the region object.\n * `update(options)` - Modify the settings of the region.\n * `play()` - Play the audio region from the start to end position.\n\n### Region Events\n\nGeneral events:\n\n * `in` - When playback enters the region.\n * `out` - When playback leaves the region.\n * `remove` - Happens just before the region is removed.\n * `update` - When the region's options are updated.\n\n Mouse events:\n\n * `click` - When the mouse clicks on the region.  Callback will receive a `MouseEvent`.\n * `dblclick` - When the mouse double-clicks on the region.  Callback will receive a `MouseEvent`.\n * `over` - When mouse moves over the region.  Callback will receive a `MouseEvent`.\n * `leave` - When mouse leaves the region.  Callback will receive a `MouseEvent`.\n\n# Credits\n\nInitial idea by [Alex Khokhulin](https://github.com/xoxulin). Many\nthanks to\n[the awesome contributors](https://github.com/katspaugh/wavesurfer.js/contributors)!\n\n# License\n\n![cc-by](http://i.creativecommons.org/l/by/3.0/88x31.png)\n\nThis work is licensed under a\n[Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/deed.en_US).\n","readmeFilename":"README.md"}