@@ -27,6 +27,50 @@ class GAPICSpeechAPI(object):
2727 def __init__ (self ):
2828 self ._gapic_api = SpeechApi ()
2929
30+ def async_recognize (self , sample , language_code = None ,
31+ max_alternatives = None , profanity_filter = None ,
32+ speech_context = None ):
33+ """Asychronous Recognize request to Google Speech API.
34+
35+ .. _async_recognize: https://cloud.google.com/speech/reference/\
36+ rest/v1beta1/speech/asyncrecognize
37+
38+ See `async_recognize`_.
39+
40+ :type sample: :class:`~google.cloud.speech.sample.Sample`
41+ :param sample: Instance of ``Sample`` containing audio information.
42+
43+ :type language_code: str
44+ :param language_code: (Optional) The language of the supplied audio as
45+ BCP-47 language tag. Example: ``'en-GB'``.
46+ If omitted, defaults to ``'en-US'``.
47+
48+ :type max_alternatives: int
49+ :param max_alternatives: (Optional) Maximum number of recognition
50+ hypotheses to be returned. The server may
51+ return fewer than maxAlternatives.
52+ Valid values are 0-30. A value of 0 or 1
53+ will return a maximum of 1. Defaults to 1
54+
55+ :type profanity_filter: bool
56+ :param profanity_filter: If True, the server will attempt to filter
57+ out profanities, replacing all but the
58+ initial character in each filtered word with
59+ asterisks, e.g. ``'f***'``. If False or
60+ omitted, profanities won't be filtered out.
61+
62+ :type speech_context: list
63+ :param speech_context: A list of strings (max 50) containing words and
64+ phrases "hints" so that the speech recognition
65+ is more likely to recognize them. This can be
66+ used to improve the accuracy for specific words
67+ and phrases. This can also be used to add new
68+ words to the vocabulary of the recognizer.
69+
70+ :raises NotImplementedError: Always.
71+ """
72+ raise NotImplementedError
73+
3074 def sync_recognize (self , sample , language_code = None , max_alternatives = None ,
3175 profanity_filter = None , speech_context = None ):
3276 """Synchronous Speech Recognition.
0 commit comments