fcernafukuzaki commited on
Commit
a7dbc3a
·
verified ·
1 Parent(s): ea9a51d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -11,7 +11,7 @@ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = '/'.join(rutas)
11
  def transcribe(file_name):
12
  """Transcribe audio bytes to text using Google Cloud Speech to Text."""
13
  if file_name is None:
14
- return ''
15
 
16
  # Crea un cliente de Speech to Text
17
  client = speech.SpeechClient()
@@ -36,8 +36,8 @@ def transcribe(file_name):
36
  confidence = []
37
  # Reads the response
38
  for result in response.results:
39
- print("Confidence: {}".format(result.confidence))
40
- confidence.append(result.confidence)
41
  print("Transcript: {}".format(result.alternatives[0].transcript))
42
  transcript.append(result.alternatives[0].transcript)
43
 
 
11
  def transcribe(file_name):
12
  """Transcribe audio bytes to text using Google Cloud Speech to Text."""
13
  if file_name is None:
14
+ return '', ''
15
 
16
  # Crea un cliente de Speech to Text
17
  client = speech.SpeechClient()
 
36
  confidence = []
37
  # Reads the response
38
  for result in response.results:
39
+ print("Confidence: {}".format(result.alternatives[0].confidence))
40
+ confidence.append(result.alternatives[0].confidence)
41
  print("Transcript: {}".format(result.alternatives[0].transcript))
42
  transcript.append(result.alternatives[0].transcript)
43