ipyaudio 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. ipyaudio-0.1.0/LICENSE.txt +27 -0
  2. ipyaudio-0.1.0/MANIFEST.in +41 -0
  3. ipyaudio-0.1.0/PKG-INFO +151 -0
  4. ipyaudio-0.1.0/README.md +83 -0
  5. ipyaudio-0.1.0/css/widget.css +23 -0
  6. ipyaudio-0.1.0/docs/Makefile +20 -0
  7. ipyaudio-0.1.0/docs/environment.yml +12 -0
  8. ipyaudio-0.1.0/docs/make.bat +36 -0
  9. ipyaudio-0.1.0/docs/source/_static/embed-bundle.js +13226 -0
  10. ipyaudio-0.1.0/docs/source/_static/embed-bundle.js.map +1 -0
  11. ipyaudio-0.1.0/docs/source/_static/helper.js +5 -0
  12. ipyaudio-0.1.0/docs/source/conf.py +213 -0
  13. ipyaudio-0.1.0/docs/source/develop-install.rst +31 -0
  14. ipyaudio-0.1.0/docs/source/examples/index.rst +18 -0
  15. ipyaudio-0.1.0/docs/source/examples/introduction.nblink +3 -0
  16. ipyaudio-0.1.0/docs/source/index.rst +49 -0
  17. ipyaudio-0.1.0/docs/source/installing.rst +37 -0
  18. ipyaudio-0.1.0/docs/source/introduction.rst +7 -0
  19. ipyaudio-0.1.0/examples/.DS_Store +0 -0
  20. ipyaudio-0.1.0/examples/.ipynb_checkpoints/introduction-checkpoint.ipynb +146 -0
  21. ipyaudio-0.1.0/examples/introduction.ipynb +138 -0
  22. ipyaudio-0.1.0/examples/sam_altman.wav +0 -0
  23. ipyaudio-0.1.0/ipyaudio/nbextension/extension.js +17 -0
  24. ipyaudio-0.1.0/ipyaudio/nbextension/index.js +13267 -0
  25. ipyaudio-0.1.0/ipyaudio/nbextension/index.js.map +1 -0
  26. ipyaudio-0.1.0/package.json +105 -0
  27. ipyaudio-0.1.0/pyproject.toml +121 -0
  28. ipyaudio-0.1.0/pytest.ini +4 -0
  29. ipyaudio-0.1.0/setup.cfg +4 -0
  30. ipyaudio-0.1.0/setup.py +2 -0
  31. ipyaudio-0.1.0/src/__tests__/index.spec.ts +26 -0
  32. ipyaudio-0.1.0/src/__tests__/utils.ts +108 -0
  33. ipyaudio-0.1.0/src/extension.ts +15 -0
  34. ipyaudio-0.1.0/src/index.ts +6 -0
  35. ipyaudio-0.1.0/src/ipyaudio.egg-info/PKG-INFO +151 -0
  36. ipyaudio-0.1.0/src/ipyaudio.egg-info/SOURCES.txt +47 -0
  37. ipyaudio-0.1.0/src/ipyaudio.egg-info/dependency_links.txt +1 -0
  38. ipyaudio-0.1.0/src/ipyaudio.egg-info/requires.txt +20 -0
  39. ipyaudio-0.1.0/src/ipyaudio.egg-info/top_level.txt +2 -0
  40. ipyaudio-0.1.0/src/player.ts +62 -0
  41. ipyaudio-0.1.0/src/plugin.ts +40 -0
  42. ipyaudio-0.1.0/src/recorder.ts +79 -0
  43. ipyaudio-0.1.0/src/version.ts +20 -0
  44. ipyaudio-0.1.0/src/wavesurfer/pcm_player.ts +119 -0
  45. ipyaudio-0.1.0/src/wavesurfer/player.ts +141 -0
  46. ipyaudio-0.1.0/src/wavesurfer/recorder.ts +182 -0
  47. ipyaudio-0.1.0/src/wavesurfer/utils.ts +137 -0
  48. ipyaudio-0.1.0/tsconfig.json +25 -0
  49. ipyaudio-0.1.0/webpack.config.js +91 -0
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2025 Zhendong Peng
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ 3. Neither the name of the copyright holder nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,41 @@
1
+ include LICENSE.txt
2
+ include README.md
3
+
4
+ include setup.py
5
+ include pyproject.toml
6
+ include pytest.ini
7
+ include .coverage.rc
8
+
9
+ include tsconfig.json
10
+ include package.json
11
+ include webpack.config.js
12
+ include ipyaudio/labextension/*.tgz
13
+
14
+ # Documentation
15
+ graft docs
16
+ exclude docs/\#*
17
+ prune docs/build
18
+ prune docs/gh-pages
19
+ prune docs/dist
20
+
21
+ # Examples
22
+ graft examples
23
+
24
+ # Tests
25
+ graft tests
26
+ prune tests/build
27
+
28
+ # Javascript files
29
+ graft ipyaudio/nbextension
30
+ graft src
31
+ graft css
32
+ prune **/node_modules
33
+ prune coverage
34
+ prune lib
35
+
36
+ # Patterns to exclude from any directory
37
+ global-exclude *~
38
+ global-exclude *.pyc
39
+ global-exclude *.pyo
40
+ global-exclude .git
41
+ global-exclude .ipynb_checkpoints
@@ -0,0 +1,151 @@
1
+ Metadata-Version: 2.2
2
+ Name: ipyaudio
3
+ Version: 0.1.0
4
+ Summary: A Custom Jupyter Widget Library
5
+ Author-email: Zhendong Peng <pzd17@tsinghua.org.cn>
6
+ License: Copyright (c) 2025 Zhendong Peng
7
+ All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are met:
11
+
12
+ 1. Redistributions of source code must retain the above copyright notice, this
13
+ list of conditions and the following disclaimer.
14
+
15
+ 2. Redistributions in binary form must reproduce the above copyright notice,
16
+ this list of conditions and the following disclaimer in the documentation
17
+ and/or other materials provided with the distribution.
18
+
19
+ 3. Neither the name of the copyright holder nor the names of its
20
+ contributors may be used to endorse or promote products derived from
21
+ this software without specific prior written permission.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+
34
+ Project-URL: Homepage, https://github.com/pengzhendong/ipyaudio
35
+ Keywords: IPython,Jupyter,Widgets
36
+ Classifier: Framework :: Jupyter
37
+ Classifier: Intended Audience :: Developers
38
+ Classifier: Intended Audience :: Science/Research
39
+ Classifier: License :: OSI Approved :: BSD License
40
+ Classifier: Programming Language :: Python
41
+ Classifier: Programming Language :: Python :: 3
42
+ Classifier: Programming Language :: Python :: 3.7
43
+ Classifier: Programming Language :: Python :: 3.8
44
+ Classifier: Programming Language :: Python :: 3.9
45
+ Classifier: Programming Language :: Python :: 3.10
46
+ Classifier: Programming Language :: Python :: 3.11
47
+ Classifier: Programming Language :: Python :: 3.12
48
+ Requires-Python: >=3.9
49
+ Description-Content-Type: text/markdown
50
+ License-File: LICENSE.txt
51
+ Requires-Dist: audiolab>=0.0.5
52
+ Requires-Dist: ipywidgets>=8.0.0
53
+ Requires-Dist: ipydatawidgets>=4.3.5
54
+ Provides-Extra: docs
55
+ Requires-Dist: jupyter_sphinx; extra == "docs"
56
+ Requires-Dist: nbsphinx; extra == "docs"
57
+ Requires-Dist: nbsphinx-link; extra == "docs"
58
+ Requires-Dist: pypandoc; extra == "docs"
59
+ Requires-Dist: pytest_check_links; extra == "docs"
60
+ Requires-Dist: recommonmark; extra == "docs"
61
+ Requires-Dist: sphinx>=1.5; extra == "docs"
62
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
63
+ Provides-Extra: examples
64
+ Provides-Extra: test
65
+ Requires-Dist: nbval; extra == "test"
66
+ Requires-Dist: pytest-cov; extra == "test"
67
+ Requires-Dist: pytest>=6.0; extra == "test"
68
+
69
+
70
+ # ipyaudio
71
+
72
+ [![Build Status](https://travis-ci.org/pengzhendong/ipyaudio.svg?branch=master)](https://travis-ci.org/pengzhendong/ipyaudio)
73
+ [![codecov](https://codecov.io/gh/pengzhendong/ipyaudio/branch/master/graph/badge.svg)](https://codecov.io/gh/pengzhendong/ipyaudio)
74
+
75
+
76
+ A Custom Jupyter Widget Library
77
+
78
+ ## Installation
79
+
80
+ You can install using `pip`:
81
+
82
+ ```bash
83
+ pip install ipyaudio
84
+ ```
85
+
86
+ If you are using Jupyter Notebook 5.2 or earlier, you may also need to enable
87
+ the nbextension:
88
+ ```bash
89
+ jupyter nbextension enable --py [--sys-prefix|--user|--system] ipyaudio
90
+ ```
91
+
92
+ ## Development Installation
93
+
94
+ Create a dev environment:
95
+ ```bash
96
+ conda create -n ipyaudio-dev -c conda-forge nodejs python jupyterlab=4.0.11
97
+ conda activate ipyaudio-dev
98
+ ```
99
+
100
+ Install the python. This will also build the TS package.
101
+ ```bash
102
+ pip install -e ".[test, examples]"
103
+ ```
104
+
105
+ When developing your extensions, you need to manually enable your extensions with the
106
+ notebook / lab frontend. For lab, this is done by the command:
107
+
108
+ ```
109
+ jupyter labextension develop --overwrite .
110
+ jlpm run build
111
+ ```
112
+
113
+ For classic notebook, you need to run:
114
+
115
+ ```
116
+ jupyter nbextension install --sys-prefix --symlink --overwrite --py ipyaudio
117
+ jupyter nbextension enable --sys-prefix --py ipyaudio
118
+ ```
119
+
120
+ Note that the `--symlink` flag doesn't work on Windows, so you will here have to run
121
+ the `install` command every time that you rebuild your extension. For certain installations
122
+ you might also need another flag instead of `--sys-prefix`, but we won't cover the meaning
123
+ of those flags here.
124
+
125
+ ### How to see your changes
126
+ #### Typescript:
127
+ If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different
128
+ terminals to watch for changes in the extension's source and automatically rebuild the widget.
129
+
130
+ ```bash
131
+ # Watch the source directory in one terminal, automatically rebuilding when needed
132
+ jlpm run watch
133
+ # Run JupyterLab in another terminal
134
+ jupyter lab
135
+ ```
136
+
137
+ After a change wait for the build to finish and then refresh your browser and the changes should take effect.
138
+
139
+ #### Python:
140
+ If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.
141
+
142
+ ## Updating the version
143
+
144
+ To update the version, install tbump and use it to bump the version.
145
+ By default it will also create a tag.
146
+
147
+ ```bash
148
+ pip install tbump
149
+ tbump <new-version>
150
+ ```
151
+
@@ -0,0 +1,83 @@
1
+
2
+ # ipyaudio
3
+
4
+ [![Build Status](https://travis-ci.org/pengzhendong/ipyaudio.svg?branch=master)](https://travis-ci.org/pengzhendong/ipyaudio)
5
+ [![codecov](https://codecov.io/gh/pengzhendong/ipyaudio/branch/master/graph/badge.svg)](https://codecov.io/gh/pengzhendong/ipyaudio)
6
+
7
+
8
+ A Custom Jupyter Widget Library
9
+
10
+ ## Installation
11
+
12
+ You can install using `pip`:
13
+
14
+ ```bash
15
+ pip install ipyaudio
16
+ ```
17
+
18
+ If you are using Jupyter Notebook 5.2 or earlier, you may also need to enable
19
+ the nbextension:
20
+ ```bash
21
+ jupyter nbextension enable --py [--sys-prefix|--user|--system] ipyaudio
22
+ ```
23
+
24
+ ## Development Installation
25
+
26
+ Create a dev environment:
27
+ ```bash
28
+ conda create -n ipyaudio-dev -c conda-forge nodejs python jupyterlab=4.0.11
29
+ conda activate ipyaudio-dev
30
+ ```
31
+
32
+ Install the python. This will also build the TS package.
33
+ ```bash
34
+ pip install -e ".[test, examples]"
35
+ ```
36
+
37
+ When developing your extensions, you need to manually enable your extensions with the
38
+ notebook / lab frontend. For lab, this is done by the command:
39
+
40
+ ```
41
+ jupyter labextension develop --overwrite .
42
+ jlpm run build
43
+ ```
44
+
45
+ For classic notebook, you need to run:
46
+
47
+ ```
48
+ jupyter nbextension install --sys-prefix --symlink --overwrite --py ipyaudio
49
+ jupyter nbextension enable --sys-prefix --py ipyaudio
50
+ ```
51
+
52
+ Note that the `--symlink` flag doesn't work on Windows, so you will here have to run
53
+ the `install` command every time that you rebuild your extension. For certain installations
54
+ you might also need another flag instead of `--sys-prefix`, but we won't cover the meaning
55
+ of those flags here.
56
+
57
+ ### How to see your changes
58
+ #### Typescript:
59
+ If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different
60
+ terminals to watch for changes in the extension's source and automatically rebuild the widget.
61
+
62
+ ```bash
63
+ # Watch the source directory in one terminal, automatically rebuilding when needed
64
+ jlpm run watch
65
+ # Run JupyterLab in another terminal
66
+ jupyter lab
67
+ ```
68
+
69
+ After a change wait for the build to finish and then refresh your browser and the changes should take effect.
70
+
71
+ #### Python:
72
+ If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.
73
+
74
+ ## Updating the version
75
+
76
+ To update the version, install tbump and use it to bump the version.
77
+ By default it will also create a tag.
78
+
79
+ ```bash
80
+ pip install tbump
81
+ tbump <new-version>
82
+ ```
83
+
@@ -0,0 +1,23 @@
1
+ .waveform {
2
+ background-color: black;
3
+ cursor: pointer;
4
+ position: relative;
5
+ width: 100%;
6
+ }
7
+
8
+ .duration, .time {
9
+ background: rgba(0, 0, 0, 0.75);
10
+ color: #DDDD;
11
+ font-size: 11px;
12
+ position: absolute;
13
+ bottom: 0;
14
+ z-index: 11;
15
+ }
16
+
17
+ .duration {
18
+ right: 0;
19
+ }
20
+
21
+ .time {
22
+ left: 0;
23
+ }
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = sphinx-build
7
+ SPHINXPROJ = ipyaudio
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,12 @@
1
+
2
+ name: ipyaudio_docs
3
+ channels:
4
+ - conda-forge
5
+ dependencies:
6
+ - python=3.*
7
+ - nodejs
8
+ - jupyter_sphinx
9
+ - sphinx
10
+ - sphinx_rtd_theme
11
+ - nbsphinx
12
+ - nbsphinx-link
@@ -0,0 +1,36 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+ set SPHINXPROJ=ipyaudio
13
+
14
+ if "%1" == "" goto help
15
+
16
+ %SPHINXBUILD% >NUL 2>NUL
17
+ if errorlevel 9009 (
18
+ echo.
19
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20
+ echo.installed, then set the SPHINXBUILD environment variable to point
21
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
22
+ echo.may add the Sphinx directory to PATH.
23
+ echo.
24
+ echo.If you don't have Sphinx installed, grab it from
25
+ echo.http://sphinx-doc.org/
26
+ exit /b 1
27
+ )
28
+
29
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30
+ goto end
31
+
32
+ :help
33
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34
+
35
+ :end
36
+ popd