Starting work on diffing system.
This commit is contained in:
parent
38eba07644
commit
eaae56627b
@ -45,20 +45,23 @@ def main():
|
||||
|
||||
# Important for linux users.
|
||||
# Prevents permanent application hang and crash by using the wrong Microphone
|
||||
if 'linux' in platform:
|
||||
mic_name = args.default_microphone
|
||||
if not mic_name or mic_name == 'list':
|
||||
print("Available microphone devices are: ")
|
||||
for index, name in enumerate(sr.Microphone.list_microphone_names()):
|
||||
print(f"Microphone with name \"{name}\" found")
|
||||
return
|
||||
else:
|
||||
for index, name in enumerate(sr.Microphone.list_microphone_names()):
|
||||
if mic_name in name:
|
||||
source = sr.Microphone(sample_rate=16000, device_index=index)
|
||||
break
|
||||
else:
|
||||
source = sr.Microphone(sample_rate=16000)
|
||||
source = None
|
||||
# if 'linux' in platform:
|
||||
# mic_name = args.default_microphone
|
||||
# if not mic_name or mic_name == 'list':
|
||||
# print("Available microphone devices are: ")
|
||||
# for index, name in enumerate(sr.Microphone.list_microphone_names()):
|
||||
# print(f"Microphone with name \"{name}\" found")
|
||||
# return
|
||||
# else:
|
||||
# for index, name in enumerate(sr.Microphone.list_microphone_names()):
|
||||
# if mic_name in name:
|
||||
# source = sr.Microphone(sample_rate=16000, device_index=index)
|
||||
# break
|
||||
# else:
|
||||
# source = sr.Microphone(sample_rate=16000)
|
||||
|
||||
source = sr.Microphone(sample_rate=16000)
|
||||
|
||||
# Load / Download model
|
||||
model = args.model
|
||||
|
Loading…
Reference in New Issue
Block a user