audio: add -> None return annotations
This commit is contained in:
@@ -55,7 +55,7 @@ class AudioPipeline:
|
||||
self._input_gain = 1.0
|
||||
self._output_gain = 1.0
|
||||
|
||||
def start(self):
|
||||
def start(self) -> None:
|
||||
"""Open audio streams."""
|
||||
import sounddevice as sd
|
||||
|
||||
@@ -81,7 +81,7 @@ class AudioPipeline:
|
||||
|
||||
log.info("audio pipeline started (rate=%d)", self._sample_rate)
|
||||
|
||||
def stop(self):
|
||||
def stop(self) -> None:
|
||||
"""Close audio streams and drain stale frames."""
|
||||
for stream in (self._input_stream, self._output_stream):
|
||||
if stream is not None:
|
||||
@@ -129,7 +129,7 @@ class AudioPipeline:
|
||||
def output_gain(self, value: float):
|
||||
self._output_gain = max(0.0, min(2.0, value))
|
||||
|
||||
def _capture_callback(self, indata, frames, time_info, status):
|
||||
def _capture_callback(self, indata, frames, time_info, status) -> None:
|
||||
"""Called by sounddevice when input data is available."""
|
||||
if status:
|
||||
log.warning("capture status: %s", status)
|
||||
@@ -142,7 +142,7 @@ class AudioPipeline:
|
||||
except queue.Full:
|
||||
pass
|
||||
|
||||
def _playback_callback(self, outdata, frames, time_info, status):
|
||||
def _playback_callback(self, outdata, frames, time_info, status) -> None:
|
||||
"""Called by sounddevice when output buffer needs data."""
|
||||
if status:
|
||||
log.warning("playback status: %s", status)
|
||||
@@ -173,7 +173,7 @@ class AudioPipeline:
|
||||
except queue.Empty:
|
||||
return None
|
||||
|
||||
def queue_playback(self, pcm_data: bytes):
|
||||
def queue_playback(self, pcm_data: bytes) -> None:
|
||||
"""Queue raw PCM data for playback (16-bit, mono, 48kHz)."""
|
||||
if self._deafened:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user