-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasic_usage.py
More file actions
25 lines (17 loc) · 755 Bytes
/
Copy pathbasic_usage.py
File metadata and controls
25 lines (17 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from __future__ import annotations
import argparse
from pathlib import Path
from audio_super_resolution import AudioSuperResolver, InferenceConfig
def main() -> int:
parser = argparse.ArgumentParser(description="Enhance one audio file.")
parser.add_argument("input", type=Path)
parser.add_argument("output", type=Path)
parser.add_argument("--target-sr", type=int, default=48000)
args = parser.parse_args()
config = InferenceConfig(device="cpu", precision="float32")
resolver = AudioSuperResolver(target_sr=args.target_sr, config=config)
result = resolver.enhance(args.input, args.output)
print(f"{result.input_path} -> {result.output_path}")
return 0
if __name__ == "__main__":
raise SystemExit(main())