Browse Source

Fixing mic example, checking if there is a Spanish system deployed

jjorgeDSIC 4 years ago
parent
commit
20fdcc398c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      python_examples/client.mic.py

+ 5 - 1
python_examples/client.mic.py

@@ -42,13 +42,17 @@ def myStreamIterator():
     stream.stop_stream()
     stream.close()
     p.terminate()
-    
+
+es_system = {}
 
 #Select Spanish system for testing
 for system in systems:
     if system['info']['langs'][0]['code'] == "es":
         es_system = system    
 
+if es_system == {}:
+    raise Exception("Spanish system not found") 
+        
 #Selects the system with the system id for the Spanish system, updated in Feb20
 for resp in cli.transcribe(es_system, myStreamIterator):
     # Hyp_var contains part of the hypothesis that is not consolidated yet (hypothesis could change)