NikilDGr8 commited on
Commit
12c3b16
1 Parent(s): 907f6f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -10
app.py CHANGED
@@ -1,20 +1,11 @@
1
- # First, ensure the necessary packages are installed:
2
- # pip install -U assemblyai gradio
3
-
4
  import gradio as gr
5
  import assemblyai as aai
6
- import os
7
 
8
  # Replace with your AssemblyAI API key
9
  aai.settings.api_key = "62acec891bb04c339ec059b738bedac6"
10
 
11
  # Function to handle audio recording and transcription
12
- def transcribe_audio(audio):
13
- # Save the recorded audio to a file
14
- audio_path = "recorded_audio.wav"
15
- with open(audio_path, "wb") as f:
16
- f.write(audio)
17
-
18
  # Transcribe the audio file using AssemblyAI
19
  transcriber = aai.Transcriber()
20
  transcript = transcriber.transcribe(audio_path)
 
 
 
 
1
  import gradio as gr
2
  import assemblyai as aai
 
3
 
4
  # Replace with your AssemblyAI API key
5
  aai.settings.api_key = "62acec891bb04c339ec059b738bedac6"
6
 
7
  # Function to handle audio recording and transcription
8
+ def transcribe_audio(audio_path):
 
 
 
 
 
9
  # Transcribe the audio file using AssemblyAI
10
  transcriber = aai.Transcriber()
11
  transcript = transcriber.transcribe(audio_path)