ipyaudio 0.1.11__py3-none-any.whl → 0.1.12__py3-none-any.whl

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 (21) hide show
  1. ipyaudio/_version.py +1 -1
  2. ipyaudio/recorder.py +22 -21
  3. {ipyaudio-0.1.11.dist-info → ipyaudio-0.1.12.dist-info}/METADATA +1 -1
  4. {ipyaudio-0.1.11.dist-info → ipyaudio-0.1.12.dist-info}/RECORD +21 -21
  5. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/etc/jupyter/nbconfig/notebook.d/ipyaudio.json +0 -0
  6. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/install.json +0 -0
  7. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/package.json +0 -0
  8. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/122.3700f0454aee82938e32.js +0 -0
  9. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/424.ca45437f3ff02b14458c.js +0 -0
  10. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/509.a9d6860fe38ae60aa71f.js +0 -0
  11. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/570.97f2a8196b7f1703e636.js +0 -0
  12. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/570.97f2a8196b7f1703e636.js.LICENSE.txt +0 -0
  13. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/58.0e2f3d700c41688625fe.js +0 -0
  14. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/style.js +0 -0
  15. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/labextensions/ipyaudio/static/third-party-licenses.json +0 -0
  16. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/nbextensions/ipyaudio/extension.js +0 -0
  17. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/nbextensions/ipyaudio/index.js +0 -0
  18. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/nbextensions/ipyaudio/index.js.LICENSE.txt +0 -0
  19. {ipyaudio-0.1.11.data → ipyaudio-0.1.12.data}/data/share/jupyter/nbextensions/ipyaudio/index.js.map +0 -0
  20. {ipyaudio-0.1.11.dist-info → ipyaudio-0.1.12.dist-info}/WHEEL +0 -0
  21. {ipyaudio-0.1.11.dist-info → ipyaudio-0.1.12.dist-info}/licenses/LICENSE.txt +0 -0
ipyaudio/_version.py CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright (c) Zhendong Peng.
5
5
  # Distributed under the terms of the Modified BSD License.
6
6
 
7
- version_info = (0, 1, 11)
7
+ version_info = (0, 1, 12)
8
8
  __version__ = ".".join(map(str, version_info))
ipyaudio/recorder.py CHANGED
@@ -105,31 +105,32 @@ class Recorder(DOMWidget, ValueWidget):
105
105
  # Sends a message to the frontend to indicate that a chunk has been received.
106
106
  self.send({"msg_type": "chunk_received"})
107
107
 
108
- if self.verbose:
109
- self._log_chunk(change["new"])
110
- self.stream_reader.push(change["new"].tobytes())
111
- for frame, _ in self.stream_reader.pull():
112
- self.audio = np.concatenate((self.audio, frame), axis=1)
113
- self.frame = frame
108
+ if self.sync:
109
+ if self.verbose:
110
+ self._log_chunk(change["new"])
111
+ self.stream_reader.push(change["new"].tobytes())
112
+ for frame, _ in self.stream_reader.pull():
113
+ self.audio = np.concatenate((self.audio, frame), axis=1)
114
+ self.frame = frame
114
115
 
115
116
  def _on_completed_change(self, change):
116
- if self.verbose:
117
- self.output_label.value = "Completed" if self.language == "en" else "完成"
118
117
  if not change["new"]:
119
- if self.verbose:
120
- self.output_label.value = "Start recording." if self.language == "en" else "开始录音."
121
- self.start = time()
122
- self.audio = np.zeros((1, 0), dtype=np.float32)
123
- self.stream_reader.reset()
118
+ if self.sync:
119
+ if self.verbose:
120
+ self.output_label.value = "Start recording." if self.language == "en" else "开始录音."
121
+ self.start = time()
122
+ self.audio = np.zeros((1, 0), dtype=np.float32)
123
+ self.stream_reader.reset()
124
124
  else:
125
- if self.verbose:
126
- self.output_label.value = "End recording." if self.language == "en" else "结束录音."
127
- for frame, _ in self.stream_reader.pull(partial=True):
128
- self.audio = np.concatenate((self.audio, frame), axis=1)
129
- self.frame = frame
130
- if self.writer is not None:
131
- self.writer.write(self.audio)
132
- self.writer.close()
125
+ if self.sync:
126
+ if self.verbose:
127
+ self.output_label.value = "End recording." if self.language == "en" else "结束录音."
128
+ for frame, _ in self.stream_reader.pull(partial=True):
129
+ self.audio = np.concatenate((self.audio, frame), axis=1)
130
+ self.frame = frame
131
+ if self.writer is not None:
132
+ self.writer.write(self.audio)
133
+ self.writer.close()
133
134
 
134
135
  def _on_rate_change(self, change):
135
136
  self.stream_reader.filters = [self.aformat(sample_rates=self.rate)]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipyaudio
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: A Custom Jupyter Widget Library
5
5
  Project-URL: Homepage, https://github.com/pengzhendong/ipyaudio
6
6
  Author-email: Zhendong Peng <pzd17@tsinghua.org.cn>
@@ -1,8 +1,8 @@
1
1
  ipyaudio/__init__.py,sha256=GO0pZvY1ER8CGSEdSgXyf9byRVCTdshf30EcqflfnGs,1859
2
2
  ipyaudio/_frontend.py,sha256=KrlHIO_mH4XmMMoLUxYJKITbVkhKip2Bhe2f1V1DtJw,246
3
- ipyaudio/_version.py,sha256=BCZMnXC-c1inGtydayzAYLhRh5_5cm53CN1iiEXrIO8,203
3
+ ipyaudio/_version.py,sha256=zvHsm3znB3cNspzPtFycXX8LKpAm9tj0GGgSfxSs3PA,203
4
4
  ipyaudio/player.py,sha256=iOqaRHWlBRRAy4D34Qu9b13twXX90zwajDRrCfiV1Io,4038
5
- ipyaudio/recorder.py,sha256=iKk_ouKoLjKscM4yHOdJv0YwQk3sfrH5GFetAo6o4fk,5649
5
+ ipyaudio/recorder.py,sha256=uv5NgsAiS1MTyE4JLM4lEVQ1qtvGREebOp4Tm2sSKm0,5685
6
6
  ipyaudio/utils.py,sha256=3SVDppL4bUPjDbSuIvMvgF43LIZ7NqOYojqKO-DCwEU,1525
7
7
  ipyaudio/widget.py,sha256=d4VBAWLuObTN76J691kmhcBAXMPPb2MiK03XWkjVU-U,975
8
8
  ipyaudio/configs/player.json,sha256=OQCglTSb3CJBl8_IRXQrmXTGC_Sg_H76E4bLZqitBFc,1030
@@ -24,22 +24,22 @@ ipyaudio/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  ipyaudio/tests/conftest.py,sha256=bvWtEyGyYxzUqTzS3Yb6E6mWOMP12SyVy9AqXvQGGLg,1415
25
25
  ipyaudio/tests/test_example.py,sha256=JLdr25MjPjNe5Wj8n7J40U14o5s4JXJpxOU9_VQrN94,278
26
26
  ipyaudio/tests/test_nbextension_path.py,sha256=t9Y4IaMOSbTzmtNxMGCldbZRExTah-b-fKwd7_2K2ys,462
27
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/package.json,sha256=AHmPjcz_36fqrYjN2DfpH84nccQ7jrqctJZvpqGSBqY,3451
28
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/122.3700f0454aee82938e32.js,sha256=NwDwRUrugpOOMpSrNaUUlDh_VcIo_CsLXqd_Dqv9aBE,1076
29
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/424.ca45437f3ff02b14458c.js,sha256=ykVDfz_wKxRFjHQ1RWY72e_gxawAVTtUY6H6_m3o1gQ,25063
30
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/509.a9d6860fe38ae60aa71f.js,sha256=qdaGD-OK5gqnH9J8i1LRsAFbaDrRt7vhCDtiyrLU_yE,632
31
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/570.97f2a8196b7f1703e636.js,sha256=g9sSzxO7BhhC5U9q-cdCAa62fsNS0H55VFy8hMZpgEM,60441
32
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/570.97f2a8196b7f1703e636.js.LICENSE.txt,sha256=Rygqb6FGni17yJNtFnwX6_D9gAlBEE3RUJeUUgjMtQE,120
33
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/58.0e2f3d700c41688625fe.js,sha256=Di89cAxBaIYl_je2RvhxQU2omDnGilR1yZv_XbLMhtA,346121
34
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/style.js,sha256=-CQt0ZTPaCTvrRiLcznxflAbfvIKlOVzjOos-muaXQ8,118
35
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/static/third-party-licenses.json,sha256=CrfTvN0gf-T_S8EYGmy2fxVO59KYlkx8LBvaMulQ9pY,15803
36
- ipyaudio-0.1.11.data/data/share/jupyter/nbextensions/ipyaudio/extension.js,sha256=DuyS9AUV37h3WxspuhDpEPTFCztkEyMWfZ5YjZSaWAg,406
37
- ipyaudio-0.1.11.data/data/share/jupyter/nbextensions/ipyaudio/index.js,sha256=973UhTZIsedPpY15Y3dFX6A9hG_vM243HNwkXO3QNZs,1252054
38
- ipyaudio-0.1.11.data/data/share/jupyter/nbextensions/ipyaudio/index.js.LICENSE.txt,sha256=Rygqb6FGni17yJNtFnwX6_D9gAlBEE3RUJeUUgjMtQE,120
39
- ipyaudio-0.1.11.data/data/share/jupyter/nbextensions/ipyaudio/index.js.map,sha256=V7OxLGkzMx_CEflY6j52vi7FDztHBk8OGKtRBk8CYHU,1820123
40
- ipyaudio-0.1.11.data/data/etc/jupyter/nbconfig/notebook.d/ipyaudio.json,sha256=BmiJxz0zncI7hb8QHtnfAykNxqSXBcVhfbWZxdBRzzw,62
41
- ipyaudio-0.1.11.data/data/share/jupyter/labextensions/ipyaudio/install.json,sha256=6bM2k1XqE-DlTYa87T6uNaTy55_-Lf2HlZFSyx5QnjY,177
42
- ipyaudio-0.1.11.dist-info/METADATA,sha256=3OcYdmvGBCQ5pR5ttYRsmDJo1fi4IrGaAa5NKQncN8c,5656
43
- ipyaudio-0.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
- ipyaudio-0.1.11.dist-info/licenses/LICENSE.txt,sha256=-uZ5GSv8HIaOXcLH77MEBajSXj7X8T5N989WfkUFYKc,1498
45
- ipyaudio-0.1.11.dist-info/RECORD,,
27
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/package.json,sha256=AHmPjcz_36fqrYjN2DfpH84nccQ7jrqctJZvpqGSBqY,3451
28
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/122.3700f0454aee82938e32.js,sha256=NwDwRUrugpOOMpSrNaUUlDh_VcIo_CsLXqd_Dqv9aBE,1076
29
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/424.ca45437f3ff02b14458c.js,sha256=ykVDfz_wKxRFjHQ1RWY72e_gxawAVTtUY6H6_m3o1gQ,25063
30
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/509.a9d6860fe38ae60aa71f.js,sha256=qdaGD-OK5gqnH9J8i1LRsAFbaDrRt7vhCDtiyrLU_yE,632
31
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/570.97f2a8196b7f1703e636.js,sha256=g9sSzxO7BhhC5U9q-cdCAa62fsNS0H55VFy8hMZpgEM,60441
32
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/570.97f2a8196b7f1703e636.js.LICENSE.txt,sha256=Rygqb6FGni17yJNtFnwX6_D9gAlBEE3RUJeUUgjMtQE,120
33
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/58.0e2f3d700c41688625fe.js,sha256=Di89cAxBaIYl_je2RvhxQU2omDnGilR1yZv_XbLMhtA,346121
34
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/style.js,sha256=-CQt0ZTPaCTvrRiLcznxflAbfvIKlOVzjOos-muaXQ8,118
35
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/static/third-party-licenses.json,sha256=CrfTvN0gf-T_S8EYGmy2fxVO59KYlkx8LBvaMulQ9pY,15803
36
+ ipyaudio-0.1.12.data/data/share/jupyter/nbextensions/ipyaudio/extension.js,sha256=DuyS9AUV37h3WxspuhDpEPTFCztkEyMWfZ5YjZSaWAg,406
37
+ ipyaudio-0.1.12.data/data/share/jupyter/nbextensions/ipyaudio/index.js,sha256=973UhTZIsedPpY15Y3dFX6A9hG_vM243HNwkXO3QNZs,1252054
38
+ ipyaudio-0.1.12.data/data/share/jupyter/nbextensions/ipyaudio/index.js.LICENSE.txt,sha256=Rygqb6FGni17yJNtFnwX6_D9gAlBEE3RUJeUUgjMtQE,120
39
+ ipyaudio-0.1.12.data/data/share/jupyter/nbextensions/ipyaudio/index.js.map,sha256=V7OxLGkzMx_CEflY6j52vi7FDztHBk8OGKtRBk8CYHU,1820123
40
+ ipyaudio-0.1.12.data/data/etc/jupyter/nbconfig/notebook.d/ipyaudio.json,sha256=BmiJxz0zncI7hb8QHtnfAykNxqSXBcVhfbWZxdBRzzw,62
41
+ ipyaudio-0.1.12.data/data/share/jupyter/labextensions/ipyaudio/install.json,sha256=6bM2k1XqE-DlTYa87T6uNaTy55_-Lf2HlZFSyx5QnjY,177
42
+ ipyaudio-0.1.12.dist-info/METADATA,sha256=0qQ3u8T5n9eNajVC16jzSmnrVmFxeuwwuhgiRPtIpmw,5656
43
+ ipyaudio-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
+ ipyaudio-0.1.12.dist-info/licenses/LICENSE.txt,sha256=-uZ5GSv8HIaOXcLH77MEBajSXj7X8T5N989WfkUFYKc,1498
45
+ ipyaudio-0.1.12.dist-info/RECORD,,