From c6309b83f89db654badc02a2461b76f1b1fbbe52 Mon Sep 17 00:00:00 2001 From: wataru Date: Sat, 18 Feb 2023 20:52:39 +0900 Subject: [PATCH] python client update --- client/python/audio_device_list.py | 7 +++---- client/python/vc_client.py | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/python/audio_device_list.py b/client/python/audio_device_list.py index 3e53d78e..85d799aa 100644 --- a/client/python/audio_device_list.py +++ b/client/python/audio_device_list.py @@ -1,5 +1,5 @@ import pyaudio - +import json if __name__ == '__main__': audio = pyaudio.PyAudio() audio_input_devices = [] @@ -26,7 +26,6 @@ if __name__ == '__main__': audio_output_devices.append({"kind": "audiooutput", "index": deviceIndex, "name": deviceName, "hostAPI": hostAPI}) audio_devices["audio_input_devices"] = audio_input_devices audio_devices["audio_output_devices"] = audio_output_devices + json_str = json.dumps(audio_devices, indent=2, ensure_ascii=True) - json_compatible_item_data = jsonable_encoder(audio_devices) - - print(json_compatible_item_data) + print(json_str) diff --git a/client/python/vc_client.py b/client/python/vc_client.py index c431057d..2c18b3a7 100644 --- a/client/python/vc_client.py +++ b/client/python/vc_client.py @@ -116,13 +116,14 @@ if __name__ == '__main__': input_device_index=inputDevice, input=True) + print("output device", outputDevice) if outputDevice >= 0: audio_output_stream = audio.open( format=pyaudio.paInt16, channels=1, rate=24000, frames_per_buffer=BUFFER_SIZE, - input_device_index=outputDevice, + output_device_index=outputDevice, output=True) else: audio_output_stream = None