pgilles commited on
Commit
1f0e5f6
Β·
1 Parent(s): b369bf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -34,7 +34,16 @@ def load_data(input_file):
34
 
35
  def asr_pipe(input_file, input_file_microphone, chunks):
36
  input_file = input_file_microphone if input_file_microphone else input_file
37
- transcription = p(input_file, chunk_length_s= chunks)["text"]
 
 
 
 
 
 
 
 
 
38
  return transcription
39
 
40
  inputs = [gr.inputs.Audio(source="upload", type='filepath', label="Eng Audio-Datei eroplueden...", optional = True),
 
34
 
35
  def asr_pipe(input_file, input_file_microphone, chunks):
36
  input_file = input_file_microphone if input_file_microphone else input_file
37
+ transcription = pipe(input_file, chunk_length_s= chunks)["text"]
38
+
39
+ # Save the transcription to a text file
40
+ with open("transcription.txt", "w") as f:
41
+ f.write(transcription)
42
+
43
+ # Save the sound file
44
+ with open("transcription.wav", "w") as f:
45
+ f.write(input_file)
46
+
47
  return transcription
48
 
49
  inputs = [gr.inputs.Audio(source="upload", type='filepath', label="Eng Audio-Datei eroplueden...", optional = True),