-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
27 lines (22 loc) · 846 Bytes
/
main.py
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
26
27
import soundfile as sf
import argparse
import numpy as np
def readAudioFile(filename):
data, samplerate = sf.read(filename)
return data, samplerate
def main():
print("Inside Main")
parser = argparse.ArgumentParser()
## Required parameters
parser.add_argument("--audio_filepath",
default=None,
type=str,
required=True,
help="The path to a single audio file")
args = parser.parse_args()
audio_filepath = args.audio_filepath # C:\Users\19498\OneDrive\Documents\CS229\LA\LA\ASVspoof2019_LA_train\flac\LA_T_1000137.flac
data, samplerate = readAudioFile(audio_filepath)
print("Audio File Shape:", data.shape)
print("samplerate:", samplerate)
if __name__ == "__main__":
main()