Skip to main content

ipywidget to interact with audio waveforms through peaks.js

Project description

peaksjs-widget

ipywidget to interact with audio waveforms through peaks.js

preview

Installation

You can install using pip:

pip install peaksjs_widget

Shortcuts

you can interact with the waveform/widgets with following shortcuts:

  • Navigation:
    • Ctrl + wheel: zoom
    • SHIFT + dbl-click: reset zoom
    • SHIFT + wheel: scroll waveform
    • arrow left/right: move playhead left/right
    • SHIFT + arrow left/right: move playhead left/right a lot.
  • Controls:
    • dbl-click: play from there
    • SPACE BAR: play/pause
  • Segments:
    • alt + click: add segment
    • SHIFT + click on a segment: remove segment
    • Ctrl + alt + click on a segment: edit segment's label
  • Points:
    • Ctrl + click: add point
    • SHIFT + click on a point: remove point
    • Ctrl + alt + click on a point: edit point's label

you can also drag points and segments' boundaries with the mouse to edit their position

Development Installation

Create a dev environment:

conda create -n peaksjs_widget-dev -c conda-forge nodejs yarn python jupyterlab
conda activate peaksjs_widget-dev

Install the python. This will also build the TS package.

pip install -e ".[test]"

When developing your extensions, you need to manually enable your extensions with the lab frontend. This is done by the command:

jupyter labextension develop --overwrite .
yarn run build

How to see your changes

Typescript:

If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the widget.

# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
# Run JupyterLab in another terminal
jupyter lab

After a change wait for the build to finish and then refresh your browser and the changes should take effect.

Python:

If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.

Updating the version

To update the version, install tbump and use it to bump the version. By default it will also create a tag.

pip install tbump
tbump <new-version>

Publish the package

on npm

npm login 
npm publish

on pypi

rm -rf dist/
pyproject-build .
twine upload dist/peaksjs* -u k-tonal

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peaksjs_widget-0.2.1.tar.gz (196.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

peaksjs_widget-0.2.1-py3-none-any.whl (274.7 kB view details)

Uploaded Python 3

File details

Details for the file peaksjs_widget-0.2.1.tar.gz.

File metadata

  • Download URL: peaksjs_widget-0.2.1.tar.gz
  • Upload date:
  • Size: 196.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.0

File hashes

Hashes for peaksjs_widget-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fc00a39be9c5cf2aba7aa647accc700e52db23266cd9162f5f7fa7824bbf6762
MD5 c61264a5210671a3ed48702656cec98e
BLAKE2b-256 b554cb71d9402086242192f7013d65eb7d2ba5ab4846ef301c1c7fc419d72466

See more details on using hashes here.

File details

Details for the file peaksjs_widget-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for peaksjs_widget-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 822841004f10f0c2d290c2103fb3cd2997f9a5d7f988d215fdafd2b730cb8cb8
MD5 f197517c171a7c295707b9af0d94e314
BLAKE2b-256 cabf5a15e995e3bc703a8e8eb408ffcda819fd5491684ef8e15cdfc003eaf62f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page