mirror of
https://github.com/shirayu/whispering.git
synced 2024-11-25 18:31:00 +00:00
Merge pull request #10 from All-Ki/show-available-devices
add --show-devices option to list available microphones
This commit is contained in:
commit
7cdecf8deb
1 changed files with 13 additions and 0 deletions
|
@ -116,6 +116,10 @@ def get_opts() -> argparse.Namespace:
|
||||||
"--mode",
|
"--mode",
|
||||||
choices=["client"],
|
choices=["client"],
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--show-devices",
|
||||||
|
action="store_true",
|
||||||
|
)
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
@ -137,6 +141,15 @@ def get_wshiper(*, opts):
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
opts = get_opts()
|
opts = get_opts()
|
||||||
|
|
||||||
|
if(opts.show_devices) :
|
||||||
|
devices = sd.query_devices()
|
||||||
|
for i, device in enumerate(devices):
|
||||||
|
if(device["max_input_channels"] > 0) :
|
||||||
|
print(f"{i}: {device['name']}")
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
basicConfig(
|
basicConfig(
|
||||||
level=DEBUG if opts.debug else INFO,
|
level=DEBUG if opts.debug else INFO,
|
||||||
format="[%(asctime)s] %(module)s.%(funcName)s:%(lineno)d %(levelname)s -> %(message)s",
|
format="[%(asctime)s] %(module)s.%(funcName)s:%(lineno)d %(levelname)s -> %(message)s",
|
||||||
|
|
Loading…
Reference in a new issue