make target folder an argument
This commit is contained in:
parent
dd7851c114
commit
c61ec44c3d
@ -1,4 +1,5 @@
|
|||||||
import requests
|
import requests
|
||||||
|
import argparse
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@ -33,11 +34,15 @@ data = {
|
|||||||
'model': 'whisper-1'
|
'model': 'whisper-1'
|
||||||
}
|
}
|
||||||
|
|
||||||
dir_path = '//mnt/c/Users/PTrowbridge/Downloads/trans'
|
# Parse command-line arguments
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('dir_path', help='path to directory containing audio files to transcribe')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Define the audio file to be transcribed
|
# Define the audio file to be transcribed
|
||||||
for file_name in os.listdir(dir_path):
|
for file_name in os.listdir(args.dir_path):
|
||||||
if file_name.endswith('.wav'):
|
if file_name.endswith('.wav'):
|
||||||
file_path = os.path.join(dir_path, file_name)
|
file_path = os.path.join(args.dir_path, file_name)
|
||||||
file_name = os.path.basename(file_path)
|
file_name = os.path.basename(file_path)
|
||||||
file_date = file_name[:10]
|
file_date = file_name[:10]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user