diff --git a/playground/streaming/transcriber/transcribe.py b/playground/streaming/transcriber/transcribe.py index 111c27246..27ec1810c 100644 --- a/playground/streaming/transcriber/transcribe.py +++ b/playground/streaming/transcriber/transcribe.py @@ -1,3 +1,4 @@ +from vocode.streaming.input_device.file_input_device import FileInputDevice from vocode.streaming.input_device.microphone_input import MicrophoneInput from vocode.streaming.models.transcriber import DeepgramTranscriberConfig, Transcription from vocode.streaming.transcriber.base_transcriber import BaseTranscriber @@ -19,19 +20,20 @@ async def print_output(transcriber: BaseTranscriber): print(transcription) async def listen(): - microphone_input = MicrophoneInput.from_default_device() + # microphone_input = MicrophoneInput.from_default_device() + input_device = FileInputDevice(file_path="spacewalk.wav") # replace with the transcriber you want to test transcriber = DeepgramTranscriber( DeepgramTranscriberConfig.from_input_device( - microphone_input, endpointing_config=DeepgramEndpointingConfig() + input_device, endpointing_config=DeepgramEndpointingConfig() ) ) transcriber.start() asyncio.create_task(print_output(transcriber)) print("Start speaking...press Ctrl+C to end. ") while True: - chunk = await microphone_input.get_audio() + chunk = await input_device.get_audio() transcriber.send_audio(chunk) asyncio.run(listen())