File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 0.1.1
2+ ------
3+ - Keep 0.75s of data before speech starts to prevent cutting off of the first syllable
4+
150.1.0
26------
37- BREAKING INTERFACE CHANGES
Original file line number Diff line number Diff line change 99 from io import BytesIO
1010
1111BUF_SIZE = (2 ** 10 )
12- SILENT_THRESH = (2 ** 10 )
12+ SILENT_THRESH = (2 ** 11 )
1313NUM_CHANNELS = 1
1414FORMAT = pyaudio .paInt16
1515RATE = 16000
@@ -173,8 +173,15 @@ def _pyaudio_record(length, silence_len):
173173 )
174174
175175 data = array .array ('h' )
176- while len (data ) == 0 or _is_silent (data ):
177- data = array .array ('h' , stream .read (BUF_SIZE , exception_on_overflow = False ))
176+ while True :
177+ d = array .array ('h' , stream .read (BUF_SIZE , exception_on_overflow = False ))
178+ if not _is_silent (d ):
179+ break
180+ data .extend (d )
181+ if len (data ) > 12 * BUF_SIZE :
182+ data = data [BUF_SIZE :]
183+
184+ yield data
178185
179186 silent_for = 0
180187 bytes_read = 0
Original file line number Diff line number Diff line change 1010 # Versions should comply with PEP440. For a discussion on single-sourcing
1111 # the version across setup.py and the project code, see
1212 # https://packaging.python.org/en/latest/single_source_version.html
13- version = '0.1.0 ' ,
13+ version = '0.1.1 ' ,
1414
1515 description = 'Python SDK for Aurora' ,
1616
You can’t perform that action at this time.
0 commit comments