mirror of
https://github.com/FAUSheppy/ths-speech
synced 2025-12-10 00:08:35 +01:00
small fixes
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
import speech_recognition as spr
|
||||
def analyse(file_path):
|
||||
import multiprocessing as mp
|
||||
import os.path
|
||||
import filesystem
|
||||
import log
|
||||
|
||||
def async_create_transcript(filename):
|
||||
mp.Process(target=create_and_save_transcript,args=(filename,)).start()
|
||||
|
||||
def create_and_save_transcript(filename):
|
||||
transcript = analyse(filename)
|
||||
filesystem.save_transcript(transcript)
|
||||
|
||||
def analyse(filename):
|
||||
''' returns the transcripted audio, or None if the analysis fails '''
|
||||
recognizer = spr.Recognizer()
|
||||
with spr.AudioFile(file_path) as source:
|
||||
with spr.AudioFile(filename) as source:
|
||||
audio = recognizer.record(source)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user