INNER CODE UNIT · Python
open_stream
thevickypedia/Jarvis · jarvis/main.py:100
def open_stream(self) -> pyaudio.Stream:
"""Initializes an audio stream.
Returns:
pyaudio.Stream:
Audio stream from pyaudio.
"""
return audio_engine.open(
rate=self.detector.sample_rate,
channels=1,
format=pyaudio.paInt16,
input=True,
frames_per_buffer=self.detector.frame_length,
input_device_index=models.env.microphone_index,
)
def executor(self) -> None:
"""Calls the listener for actionable phrase and runs the speaker node for response."""