puuush
puzshsahc usah
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import os, pymupdf
|
||||
import os, pymupdf, whisper, json
|
||||
|
||||
def read_files(path, output, filetypes=None):
|
||||
if filetypes is None:
|
||||
@@ -19,4 +19,13 @@ def extract_pdf_content(pdf_datei):
|
||||
a = ""
|
||||
for page in doc:
|
||||
a += page.get_text()
|
||||
return a
|
||||
return a
|
||||
|
||||
|
||||
def extract_mp3_content(mp3_datei):
|
||||
model = whisper.load_model('tiny')
|
||||
|
||||
result = model.transcribe(str(mp3_datei), language='de', verbose=True)
|
||||
|
||||
with open('transcript.json', "w") as f:
|
||||
json.dump(result['text'], f, indent=4)
|
||||
Reference in New Issue
Block a user