Spaces:
Sleeping
Sleeping
beweinreich
commited on
Commit
•
c32c2b4
1
Parent(s):
402485b
improved analyzer
Browse files- .gitignore +1 -0
- audio_analyzer.py +3 -2
.gitignore
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
.DS_Store
|
2 |
.env
|
3 |
raw/*
|
|
|
4 |
__pycache__/*
|
|
|
1 |
.DS_Store
|
2 |
.env
|
3 |
raw/*
|
4 |
+
tmp/*.mp3
|
5 |
__pycache__/*
|
audio_analyzer.py
CHANGED
@@ -55,9 +55,9 @@ class AudioAnalyzer:
|
|
55 |
clip = mp.VideoFileClip(video_file)
|
56 |
clip.audio.write_audiofile(audio_file)
|
57 |
|
58 |
-
def convert_audio_to_mp3(self, audio_file, mp3_file):
|
59 |
clip = mp.AudioFileClip(audio_file)
|
60 |
-
clip.write_audiofile(mp3_file)
|
61 |
|
62 |
def transcribe_audio_to_text(self, audio_file):
|
63 |
with open(audio_file, "rb") as audio:
|
@@ -66,6 +66,7 @@ class AudioAnalyzer:
|
|
66 |
file=audio
|
67 |
)
|
68 |
video_text = transcription.text.strip()
|
|
|
69 |
return video_text
|
70 |
|
71 |
def retrieve_traits(self):
|
|
|
55 |
clip = mp.VideoFileClip(video_file)
|
56 |
clip.audio.write_audiofile(audio_file)
|
57 |
|
58 |
+
def convert_audio_to_mp3(self, audio_file, mp3_file, bitrate="32k"):
|
59 |
clip = mp.AudioFileClip(audio_file)
|
60 |
+
clip.write_audiofile(mp3_file, bitrate=bitrate)
|
61 |
|
62 |
def transcribe_audio_to_text(self, audio_file):
|
63 |
with open(audio_file, "rb") as audio:
|
|
|
66 |
file=audio
|
67 |
)
|
68 |
video_text = transcription.text.strip()
|
69 |
+
print(video_text)
|
70 |
return video_text
|
71 |
|
72 |
def retrieve_traits(self):
|