hackerbot 0.4.0__py3-none-any.whl → 0.5.0__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.
@@ -69,12 +69,19 @@ class Head():
69
69
 
70
70
  # Setup a sounddevice OutputStream with appropriate parameters
71
71
  # The sample rate and channels should match the properties of the PCM data
72
- stream = sd.OutputStream(samplerate=voice.config.sample_rate, channels=1, dtype='int16')
73
- stream.start()
72
+ stream = sd.OutputStream(
73
+ samplerate=voice.config.sample_rate,
74
+ channels=1,
75
+ dtype='int16',
76
+ blocksize=0 # Let sounddevice choose blocksize automatically
77
+ )
74
78
 
75
- for audio_bytes in voice.synthesize_stream_raw(text, speaker_id = speaker_id):
76
- int_data = np.frombuffer(audio_bytes, dtype=np.int16)
77
- stream.write(int_data)
79
+ with stream: # This automatically handles start/stop/close
80
+ for audio_bytes in voice.synthesize_stream_raw(text, speaker_id=speaker_id):
81
+ int_data = np.frombuffer(audio_bytes, dtype=np.int16)
82
+ stream.write(int_data)
78
83
 
79
- stream.stop()
80
- stream.close()
84
+ # At this point, all data has been written,
85
+ # but we need to wait for any remaining buffered audio to play out.
86
+ stream.stop() # Ensure stream stops cleanly
87
+ print("Finished speaking.") # <-- You now know it's done
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hackerbot
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: This module contains the setup for the hackerbot python package.
5
5
  Author-email: Allen Chien <allen@hackerbot.co>
6
6
  License-Expression: MIT
@@ -12,9 +12,9 @@ Requires-Dist: pyserial
12
12
  Requires-Dist: pytest
13
13
  Requires-Dist: piper-tts
14
14
  Requires-Dist: sounddevice
15
+ Requires-Dist: pyaudio
15
16
  Dynamic: license-file
16
17
 
17
-
18
18
  # Hackerbot Python Package
19
19
 
20
20
  Hackerbot python package (`hackerbot-python-package`) is a project that includes modules for controlling and managing the Hackerbot system.
@@ -4,12 +4,12 @@ hackerbot/arm/__init__.py,sha256=JdCmTDQ2qk3W8-Alc4mjaQYxHnmH26r0nSy0JFg6J4A,340
4
4
  hackerbot/arm/gripper.py,sha256=xZux0PZL4vvrJTTKHL7dDsRBfJr4zbmgMaA0uBR1u4s,1986
5
5
  hackerbot/base/__init__.py,sha256=PG2Ykn2MLfobAWClGFnp-AZfh1xVsnbc1nQ8E6Yy6eA,8698
6
6
  hackerbot/base/maps.py,sha256=I_4NdvOMnkHX6-mW43QpDPJ-eVc6npgcBXq99tU7D1g,5916
7
- hackerbot/head/__init__.py,sha256=VvKc6Gy3hNARUbFf8HoKkc2TFWoSSswrJbqytvEKUSA,3186
7
+ hackerbot/head/__init__.py,sha256=w4mhnz70miLaChxxF-8bGntDRo8GFLTFICxtTWJX2Iw,3581
8
8
  hackerbot/head/eyes.py,sha256=xqeKMxL12iaa8KQzDlbgbNy3LzcmWm8aXkebztYJ4P8,1370
9
9
  hackerbot/utils/hackerbot_helper.py,sha256=egQPVBBUo52ywsO6jGAGVqhyGLpMPz-b2fgLBb39WSM,4998
10
10
  hackerbot/utils/serial_helper.py,sha256=qo-mpbE_sb23_IAIfDuRT8sCDtW8d8A8qyav-b9e5Kw,6567
11
- hackerbot-0.4.0.dist-info/licenses/LICENSE,sha256=SCcXH0bf35ISRu_Ks8xEKySHXiqclANLWhBUbVU8VvA,1081
12
- hackerbot-0.4.0.dist-info/METADATA,sha256=aDFIV8XyatIX9BXO9Ck9LDqtsoMSokV0iqNSXcyOfj4,1764
13
- hackerbot-0.4.0.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
14
- hackerbot-0.4.0.dist-info/top_level.txt,sha256=2n_FStAr1SiI3BV67x7KJHYIOmEwxjUD59zedw2hLkU,10
15
- hackerbot-0.4.0.dist-info/RECORD,,
11
+ hackerbot-0.5.0.dist-info/licenses/LICENSE,sha256=SCcXH0bf35ISRu_Ks8xEKySHXiqclANLWhBUbVU8VvA,1081
12
+ hackerbot-0.5.0.dist-info/METADATA,sha256=TjRFtJ_ZSFGW50WkBhwEHlQfNkOXSJWd5wXZgasXoJ0,1786
13
+ hackerbot-0.5.0.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
14
+ hackerbot-0.5.0.dist-info/top_level.txt,sha256=2n_FStAr1SiI3BV67x7KJHYIOmEwxjUD59zedw2hLkU,10
15
+ hackerbot-0.5.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.1)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5