s1ri1337 commited on
Commit
199a359
1 Parent(s): ad0b7d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import speech_recognition as sr
2
  from googletrans import Translator
3
- from httpcore import SyncHTTPProxy
4
-
5
  http_proxy = SyncHTTPProxy((b'http', b'myproxy.com', 8080, b''))
6
  proxies = {'http': http_proxy, 'https': http_proxy }
7
 
@@ -38,4 +38,13 @@ def translate():
38
 
39
  gr.Interface(
40
  fn=translate,
41
- inputs=gr.Audio(source="microphone", type="numpy"), outputs="text").launch()
 
 
 
 
 
 
 
 
 
 
1
  import speech_recognition as sr
2
  from googletrans import Translator
3
+ #from httpcore import SyncHTTPProxy
4
+ """
5
  http_proxy = SyncHTTPProxy((b'http', b'myproxy.com', 8080, b''))
6
  proxies = {'http': http_proxy, 'https': http_proxy }
7
 
 
38
 
39
  gr.Interface(
40
  fn=translate,
41
+ inputs=gr.Audio(source="microphone", type="numpy"), outputs="text").launch()
42
+ """
43
+ def transcribe(audio):
44
+ text = p(audio)["text"]
45
+ return text
46
+
47
+ gr.Interface(
48
+ fn=transcribe,
49
+ inputs=gr.Audio(source="microphone", type="filepath"),
50
+ outputs="text").launch()