mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 05:25:01 +03:00
python client update
This commit is contained in:
parent
fc5c4aa2fb
commit
c6309b83f8
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user