File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import bisect
55import re
66import wave
7- from audioop import byteswap
87from base64 import b64decode
98from collections import defaultdict
109from dataclasses import dataclass
Original file line number Diff line number Diff line change 7171SPEECH_TEMPO_ADJUSTMENT_FACTOR_DEFAULT = 0.75
7272
7373# Queue Config Constants
74- DESIRED_QUEUE_LEVEL_MS_DEFAULT = 10000
74+ DESIRED_QUEUE_LEVEL_MS_DEFAULT = 5000
7575MAX_QUEUE_LEVEL_MS_DEFAULT = 24000
76- QUEUE_MIN_TEMPO = 1.0
77- QUEUE_MAX_TEMPO = 1.2
76+ QUEUE_MIN_TEMPO = 1.15
77+ QUEUE_MAX_TEMPO = 1.45
7878
7979# TranscriptionMessage Constants
8080MIN_ALIGNMENT_SCORE_DEFAULT = 0.2
Original file line number Diff line number Diff line change @@ -59,8 +59,8 @@ class Io(Task):
5959 @property
6060 def io_data (self ) -> IoData :
6161 return IoData (
62- start_perf_ts = self .global_start_perf_ts ,
63- start_utc_ts = self .global_start_utc_ts ,
62+ start_perf_ts = self .global_start_perf_ts or 0.0 ,
63+ start_utc_ts = self .global_start_utc_ts or 0.0 ,
6464 in_sr = self .cfg .mode .input_sample_rate ,
6565 out_sr = self .cfg .mode .output_sample_rate ,
6666 mode = self .cfg .mode .name ,
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ def test_translation():
222222def test_queue_configs ():
223223 """Test QueueConfigs with alias"""
224224 qc = QueueConfigs ()
225- assert qc .global_ .desired_queue_level_ms == 10000
225+ assert qc .global_ .desired_queue_level_ms == 5000
226226 assert qc .global_ .max_queue_level_ms == 24000
227227 assert qc .global_ .auto_tempo is True
228228
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ def test_tts_constants():
7979
8080def test_queue_config_constants ():
8181 """Test queue config constants"""
82- assert constant .DESIRED_QUEUE_LEVEL_MS_DEFAULT == 10000
82+ assert constant .DESIRED_QUEUE_LEVEL_MS_DEFAULT == 5000
8383 assert constant .MAX_QUEUE_LEVEL_MS_DEFAULT == 24000
8484
8585
Original file line number Diff line number Diff line change @@ -107,6 +107,20 @@ async def test_read_at_eof(self):
107107 mock_debug .assert_called_once ()
108108 assert "EOF reached" in str (mock_debug .call_args [0 ][0 ])
109109
110+ @pytest .mark .asyncio
111+ async def test_empty_buffer_immediate_eof (self ):
112+ """Test that empty buffer immediately returns EOF without crashing"""
113+ empty_buffer = io .BytesIO (b"" )
114+ reader = BufferReader (buffer = empty_buffer )
115+ reader .ready = TaskEvent ()
116+ + reader .ready
117+
118+ # Reading from empty buffer should return None and set EOF
119+ data = await reader .read (100 )
120+ assert data is None
121+ assert reader .eof .is_set ()
122+ assert reader ._position == 0
123+
110124
111125class TestBufferWriter :
112126 """Test BufferWriter class"""
You can’t perform that action at this time.
0 commit comments