Merge remote-tracking branch 'origin/dev' into feat/vad-agent

# Conflicts:
#	pyproject.toml
#	src/control_backend/main.py
#	uv.lock
This commit is contained in:
Twirre Meulenbelt
2025-10-28 10:44:03 +01:00
18 changed files with 271 additions and 95 deletions

View File

@@ -48,14 +48,14 @@ async def test_voice_activity_detected(audio_in_socket, audio_out_socket, stream
:return:
"""
speech_chunk_count = 5
probabilities = [0.0]*5 + [1.0]*speech_chunk_count + [0.0]*5
probabilities = [0.0] * 5 + [1.0] * speech_chunk_count + [0.0] * 5
await simulate_streaming_with_probabilities(streaming, probabilities)
audio_out_socket.send.assert_called_once()
data = audio_out_socket.send.call_args[0][0]
assert isinstance(data, bytes)
# each sample has 512 frames of 4 bytes, expecting 7 chunks (5 with speech, 2 as padding)
assert len(data) == 512*4*(speech_chunk_count+2)
assert len(data) == 512 * 4 * (speech_chunk_count + 2)
@pytest.mark.asyncio
@@ -65,14 +65,16 @@ async def test_voice_activity_short_pause(audio_in_socket, audio_out_socket, str
short pause.
"""
speech_chunk_count = 5
probabilities = [0.0]*5 + [1.0]*speech_chunk_count + [0.0] + [1.0]*speech_chunk_count + [0.0]*5
probabilities = (
[0.0] * 5 + [1.0] * speech_chunk_count + [0.0] + [1.0] * speech_chunk_count + [0.0] * 5
)
await simulate_streaming_with_probabilities(streaming, probabilities)
audio_out_socket.send.assert_called_once()
data = audio_out_socket.send.call_args[0][0]
assert isinstance(data, bytes)
# Expecting 13 chunks (2*5 with speech, 1 pause between, 2 as padding)
assert len(data) == 512*4*(speech_chunk_count*2+1+2)
assert len(data) == 512 * 4 * (speech_chunk_count * 2 + 1 + 2)
@pytest.mark.asyncio