Skip to content

start_call_analytics_stream_transcription async

start_call_analytics_stream_transcription(
    media_sample_rate_hertz: MediaSampleRateHertz,
    media_encoding: MediaEncoding,
    audio_stream: AsyncIterator[_AudioStream] | _AudioStream,
    *,
    config_overrides: Optional[AsyncTranscribeStreamingClientConfig] = None,
    language_code: Optional[CallAnalyticsLanguageCode] = None,
    vocabulary_name: Optional[VocabularyName] = None,
    session_id: Optional[SessionId] = None,
    vocabulary_filter_name: Optional[VocabularyFilterName] = None,
    vocabulary_filter_method: Optional[VocabularyFilterMethod] = None,
    language_model_name: Optional[ModelName] = None,
    identify_language: Optional[Boolean] = None,
    language_options: Optional[LanguageOptions] = None,
    preferred_language: Optional[CallAnalyticsLanguageCode] = None,
    vocabulary_names: Optional[VocabularyNames] = None,
    vocabulary_filter_names: Optional[VocabularyFilterNames] = None,
    enable_partial_results_stabilization: Optional[Boolean] = None,
    partial_results_stability: Optional[PartialResultsStability] = None,
    content_identification_type: Optional[ContentIdentificationType] = None,
    content_redaction_type: Optional[ContentRedactionType] = None,
    pii_entity_types: Optional[PiiEntityTypes] = None,
) -> AsyncGenerator[StartCallAnalyticsStreamTranscriptionResponse]

Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to Amazon Transcribe and the transcription results are streamed to your application. Use this operation for Call Analytics transcriptions.

The following parameters are required:

  • language-code or identify-language

  • media-encoding

  • sample-rate

For more information on streaming with Amazon Transcribe, see Transcribing streaming audio.

Parameters:

  • language_code (Optional[CallAnalyticsLanguageCode], default: None ) –

    Specify the language code that represents the language spoken in your audio.

    For a list of languages supported with real-time Call Analytics, refer to the Supported languages table.

  • media_sample_rate_hertz (MediaSampleRateHertz) –

    The sample rate of the input audio (in hertz). Low-quality audio, such as telephone audio, is typically around 8,000 Hz. High-quality audio typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must match that of your audio.

  • media_encoding (MediaEncoding) –

    Specify the encoding of your input audio. Supported formats are:

    • FLAC

    • OPUS-encoded audio in an Ogg container

    • PCM (only signed 16-bit little-endian audio formats, which does not include WAV)

    For more information, see Media formats.

  • vocabulary_name (Optional[VocabularyName], default: None ) –

    Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.

    If the language of the specified custom vocabulary doesn't match the language identified in your media, the custom vocabulary is not applied to your transcription.

    For more information, see Custom vocabularies.

  • session_id (Optional[SessionId], default: None ) –

    Specify a name for your Call Analytics transcription session. If you don't include this parameter in your request, Amazon Transcribe generates an ID and returns it in the response.

  • audio_stream (AsyncIterator[_AudioStream] | _AudioStream) –

    An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or WebSocket data frames.

    For more information, see Transcribing streaming audio.

  • vocabulary_filter_name (Optional[VocabularyFilterName], default: None ) –

    Specify the name of the custom vocabulary filter that you want to use when processing your transcription. Note that vocabulary filter names are case sensitive.

    If the language of the specified custom vocabulary filter doesn't match the language identified in your media, the vocabulary filter is not applied to your transcription.

    For more information, see Using vocabulary filtering with unwanted words.

  • vocabulary_filter_method (Optional[VocabularyFilterMethod], default: None ) –

    Specify how you want your vocabulary filter applied to your transcript.

    To replace words with ***, choose mask.

    To delete words, choose remove.

    To flag words without changing them, choose tag.

  • language_model_name (Optional[ModelName], default: None ) –

    Specify the name of the custom language model that you want to use when processing your transcription. Note that language model names are case sensitive.

    The language of the specified language model must match the language code you specify in your transcription request. If the languages don't match, the custom language model isn't applied. There are no errors or warnings associated with a language mismatch.

    For more information, see Custom language models.

  • identify_language (Optional[Boolean], default: None ) –

    Enables automatic language identification for your Call Analytics transcription.

    If you include IdentifyLanguage, you must include a list of language codes, using LanguageOptions, that you think may be present in your audio stream. You must provide a minimum of two language selections.

    You can also include a preferred language using PreferredLanguage. Adding a preferred language can help Amazon Transcribe identify the language faster than if you omit this parameter.

    Note that you must include either LanguageCode or IdentifyLanguage in your request. If you include both parameters, your transcription job fails.

  • language_options (Optional[LanguageOptions], default: None ) –

    Specify two or more language codes that represent the languages you think may be present in your media.

    Including language options can improve the accuracy of language identification.

    If you include LanguageOptions in your request, you must also include IdentifyLanguage.

    For a list of languages supported with Call Analytics streaming, refer to the Supported languages table.

    You can only include one language dialect per language per stream. For example, you cannot include en-US and en-AU in the same request.

  • preferred_language (Optional[CallAnalyticsLanguageCode], default: None ) –

    Specify a preferred language from the subset of languages codes you specified in LanguageOptions.

    You can only use this parameter if you've included IdentifyLanguage and LanguageOptions in your request.

  • vocabulary_names (Optional[VocabularyNames], default: None ) –

    Specify the names of the custom vocabularies that you want to use when processing your Call Analytics transcription. Note that vocabulary names are case sensitive.

    If the custom vocabulary's language doesn't match the identified media language, it won't be applied to the transcription.

    This parameter is only intended for use with the IdentifyLanguage parameter. If you're not including IdentifyLanguage in your request and want to use a custom vocabulary with your transcription, use the VocabularyName parameter instead.

    For more information, see Custom vocabularies.

  • vocabulary_filter_names (Optional[VocabularyFilterNames], default: None ) –

    Specify the names of the custom vocabulary filters that you want to use when processing your Call Analytics transcription. Note that vocabulary filter names are case sensitive.

    These filters serve to customize the transcript output.

    This parameter is only intended for use with the IdentifyLanguage parameter. If you're not including IdentifyLanguage in your request and want to use a custom vocabulary filter with your transcription, use the VocabularyFilterName parameter instead.

    For more information, see Using vocabulary filtering with unwanted words.

  • enable_partial_results_stabilization (Optional[Boolean], default: None ) –

    Enables partial result stabilization for your transcription. Partial result stabilization can reduce latency in your output, but may impact accuracy. For more information, see Partial-result stabilization.

  • partial_results_stability (Optional[PartialResultsStability], default: None ) –

    Specify the level of stability to use when you enable partial results stabilization (EnablePartialResultsStabilization).

    Low stability provides the highest accuracy. High stability transcribes faster, but with slightly lower accuracy.

    For more information, see Partial-result stabilization.

  • content_identification_type (Optional[ContentIdentificationType], default: None ) –

    Labels all personally identifiable information (PII) identified in your transcript.

    Content identification is performed at the segment level; PII specified in PiiEntityTypes is flagged upon complete transcription of an audio segment. If you don't include PiiEntityTypes in your request, all PII is identified.

    You can’t set ContentIdentificationType and ContentRedactionType in the same request. If you set both, your request returns a BadRequestException.

    For more information, see Redacting or identifying personally identifiable information.

  • content_redaction_type (Optional[ContentRedactionType], default: None ) –

    Redacts all personally identifiable information (PII) identified in your transcript.

    Content redaction is performed at the segment level; PII specified in PiiEntityTypes is redacted upon complete transcription of an audio segment. If you don't include PiiEntityTypes in your request, all PII is redacted.

    You can’t set ContentRedactionType and ContentIdentificationType in the same request. If you set both, your request returns a BadRequestException.

    For more information, see Redacting or identifying personally identifiable information.

  • pii_entity_types (Optional[PiiEntityTypes], default: None ) –

    Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can include as many types as you'd like, or you can select ALL.

    Values must be comma-separated and can include: ADDRESS, BANK_ACCOUNT_NUMBER, BANK_ROUTING, CREDIT_DEBIT_CVV, CREDIT_DEBIT_EXPIRY, CREDIT_DEBIT_NUMBER, EMAIL, NAME, PHONE, PIN, SSN, or ALL.

    Note that if you include PiiEntityTypes in your request, you must also include ContentIdentificationType or ContentRedactionType.

    If you include ContentRedactionType or ContentIdentificationType in your request, but do not include PiiEntityTypes, all PII is redacted or identified.

Raises:

  • BadRequestException –

    One or more arguments to the StartStreamTranscription, StartMedicalStreamTranscription, or StartCallAnalyticsStreamTranscription operation was not valid. For example, MediaEncoding or LanguageCode used unsupported values. Check the specified parameters and try your request again.

  • ConflictException –

    A new stream started with the same session ID. The current stream has been terminated.

  • InternalFailureException –

    A problem occurred while processing the audio. Amazon Transcribe terminated processing.

  • LimitExceededException –

    Your client has exceeded one of the Amazon Transcribe limits, typically the concurrent stream service quota. This error can also occur if a stream exceeds the maximum session duration. In rare cases, this error can also occur if you increase your number of concurrent streams too quickly. Reduce your number of concurrent streams and try your request again using an exponential backoff strategy.

  • ServiceUnavailableException –

    The service is currently unavailable. Try your request later.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_transcribe_streaming/_services/async_transcribe_streaming.py
@asynccontextmanager
async def start_call_analytics_stream_transcription(
    self,
    media_sample_rate_hertz: "capo_transcribe_streaming.types.media_sample_rate_hertz.MediaSampleRateHertz",
    media_encoding: "capo_transcribe_streaming.types.media_encoding.MediaEncoding",
    audio_stream: "AsyncIterator[capo_transcribe_streaming.types.audio_stream._AudioStream] | capo_transcribe_streaming.types.audio_stream._AudioStream",
    *,
    config_overrides: Optional[AsyncTranscribeStreamingClientConfig] = None,
    language_code: Optional[
        "capo_transcribe_streaming.types.call_analytics_language_code.CallAnalyticsLanguageCode"
    ] = None,
    vocabulary_name: Optional[
        "capo_transcribe_streaming.types.vocabulary_name.VocabularyName"
    ] = None,
    session_id: Optional[
        "capo_transcribe_streaming.types.session_id.SessionId"
    ] = None,
    vocabulary_filter_name: Optional[
        "capo_transcribe_streaming.types.vocabulary_filter_name.VocabularyFilterName"
    ] = None,
    vocabulary_filter_method: Optional[
        "capo_transcribe_streaming.types.vocabulary_filter_method.VocabularyFilterMethod"
    ] = None,
    language_model_name: Optional[
        "capo_transcribe_streaming.types.model_name.ModelName"
    ] = None,
    identify_language: Optional[
        "capo_transcribe_streaming.types.boolean.Boolean"
    ] = None,
    language_options: Optional[
        "capo_transcribe_streaming.types.language_options.LanguageOptions"
    ] = None,
    preferred_language: Optional[
        "capo_transcribe_streaming.types.call_analytics_language_code.CallAnalyticsLanguageCode"
    ] = None,
    vocabulary_names: Optional[
        "capo_transcribe_streaming.types.vocabulary_names.VocabularyNames"
    ] = None,
    vocabulary_filter_names: Optional[
        "capo_transcribe_streaming.types.vocabulary_filter_names.VocabularyFilterNames"
    ] = None,
    enable_partial_results_stabilization: Optional[
        "capo_transcribe_streaming.types.boolean.Boolean"
    ] = None,
    partial_results_stability: Optional[
        "capo_transcribe_streaming.types.partial_results_stability.PartialResultsStability"
    ] = None,
    content_identification_type: Optional[
        "capo_transcribe_streaming.types.content_identification_type.ContentIdentificationType"
    ] = None,
    content_redaction_type: Optional[
        "capo_transcribe_streaming.types.content_redaction_type.ContentRedactionType"
    ] = None,
    pii_entity_types: Optional[
        "capo_transcribe_streaming.types.pii_entity_types.PiiEntityTypes"
    ] = None,
) -> "AsyncGenerator[capo_transcribe_streaming.types.start_call_analytics_stream_transcription_response.StartCallAnalyticsStreamTranscriptionResponse]":
    """<p>Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to Amazon Transcribe and the transcription results are streamed to your application. Use this operation for <a href="https://docs.aws.amazon.com/transcribe/latest/dg/call-analytics.html">Call Analytics</a> transcriptions.</p> <p>The following parameters are required:</p> <ul> <li> <p> <code>language-code</code> or <code>identify-language</code> </p> </li> <li> <p> <code>media-encoding</code> </p> </li> <li> <p> <code>sample-rate</code> </p> </li> </ul> <p>For more information on streaming with Amazon Transcribe, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html">Transcribing streaming audio</a>.</p>

    Args:
        language_code: <p>Specify the language code that represents the language spoken in your audio.</p> <p>For a list of languages supported with real-time Call Analytics, refer to the <a href="https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html">Supported languages</a> table.</p>
        media_sample_rate_hertz: <p>The sample rate of the input audio (in hertz). Low-quality audio, such as telephone audio, is typically around 8,000 Hz. High-quality audio typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must match that of your audio.</p>
        media_encoding: <p>Specify the encoding of your input audio. Supported formats are:</p> <ul> <li> <p>FLAC</p> </li> <li> <p>OPUS-encoded audio in an Ogg container</p> </li> <li> <p>PCM (only signed 16-bit little-endian audio formats, which does not include WAV)</p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio">Media formats</a>.</p>
        vocabulary_name: <p>Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p> <p>If the language of the specified custom vocabulary doesn't match the language identified in your media, the custom vocabulary is not applied to your transcription.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html">Custom vocabularies</a>.</p>
        session_id: <p>Specify a name for your Call Analytics transcription session. If you don't include this parameter in your request, Amazon Transcribe generates an ID and returns it in the response.</p>
        audio_stream: <p>An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or WebSocket data frames.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html">Transcribing streaming audio</a>.</p>
        vocabulary_filter_name: <p>Specify the name of the custom vocabulary filter that you want to use when processing your transcription. Note that vocabulary filter names are case sensitive.</p> <p>If the language of the specified custom vocabulary filter doesn't match the language identified in your media, the vocabulary filter is not applied to your transcription.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html">Using vocabulary filtering with unwanted words</a>.</p>
        vocabulary_filter_method: <p>Specify how you want your vocabulary filter applied to your transcript.</p> <p>To replace words with <code>***</code>, choose <code>mask</code>.</p> <p>To delete words, choose <code>remove</code>.</p> <p>To flag words without changing them, choose <code>tag</code>.</p>
        language_model_name: <p>Specify the name of the custom language model that you want to use when processing your transcription. Note that language model names are case sensitive.</p> <p>The language of the specified language model must match the language code you specify in your transcription request. If the languages don't match, the custom language model isn't applied. There are no errors or warnings associated with a language mismatch.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html">Custom language models</a>.</p>
        identify_language: <p>Enables automatic language identification for your Call Analytics transcription.</p> <p>If you include <code>IdentifyLanguage</code>, you must include a list of language codes, using <code>LanguageOptions</code>, that you think may be present in your audio stream. You must provide a minimum of two language selections.</p> <p>You can also include a preferred language using <code>PreferredLanguage</code>. Adding a preferred language can help Amazon Transcribe identify the language faster than if you omit this parameter.</p> <p>Note that you must include either <code>LanguageCode</code> or <code>IdentifyLanguage</code> in your request. If you include both parameters, your transcription job fails.</p>
        language_options: <p>Specify two or more language codes that represent the languages you think may be present in your media.</p> <p>Including language options can improve the accuracy of language identification.</p> <p>If you include <code>LanguageOptions</code> in your request, you must also include <code>IdentifyLanguage</code>.</p> <p>For a list of languages supported with Call Analytics streaming, refer to the <a href="https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html">Supported languages</a> table.</p> <important> <p>You can only include one language dialect per language per stream. For example, you cannot include <code>en-US</code> and <code>en-AU</code> in the same request.</p> </important>
        preferred_language: <p>Specify a preferred language from the subset of languages codes you specified in <code>LanguageOptions</code>.</p> <p>You can only use this parameter if you've included <code>IdentifyLanguage</code> and <code>LanguageOptions</code> in your request.</p>
        vocabulary_names: <p>Specify the names of the custom vocabularies that you want to use when processing your Call Analytics transcription. Note that vocabulary names are case sensitive.</p> <p>If the custom vocabulary's language doesn't match the identified media language, it won't be applied to the transcription.</p> <important> <p>This parameter is only intended for use <b>with</b> the <code>IdentifyLanguage</code> parameter. If you're <b>not</b> including <code>IdentifyLanguage</code> in your request and want to use a custom vocabulary with your transcription, use the <code>VocabularyName</code> parameter instead.</p> </important> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html">Custom vocabularies</a>.</p>
        vocabulary_filter_names: <p>Specify the names of the custom vocabulary filters that you want to use when processing your Call Analytics transcription. Note that vocabulary filter names are case sensitive.</p> <p>These filters serve to customize the transcript output.</p> <important> <p>This parameter is only intended for use <b>with</b> the <code>IdentifyLanguage</code> parameter. If you're <b>not</b> including <code>IdentifyLanguage</code> in your request and want to use a custom vocabulary filter with your transcription, use the <code>VocabularyFilterName</code> parameter instead.</p> </important> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html">Using vocabulary filtering with unwanted words</a>.</p>
        enable_partial_results_stabilization: <p>Enables partial result stabilization for your transcription. Partial result stabilization can reduce latency in your output, but may impact accuracy. For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization">Partial-result stabilization</a>.</p>
        partial_results_stability: <p>Specify the level of stability to use when you enable partial results stabilization (<code>EnablePartialResultsStabilization</code>).</p> <p>Low stability provides the highest accuracy. High stability transcribes faster, but with slightly lower accuracy.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization">Partial-result stabilization</a>.</p>
        content_identification_type: <p>Labels all personally identifiable information (PII) identified in your transcript.</p> <p>Content identification is performed at the segment level; PII specified in <code>PiiEntityTypes</code> is flagged upon complete transcription of an audio segment. If you don't include <code>PiiEntityTypes</code> in your request, all PII is identified.</p> <p>You can’t set <code>ContentIdentificationType</code> and <code>ContentRedactionType</code> in the same request. If you set both, your request returns a <code>BadRequestException</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html">Redacting or identifying personally identifiable information</a>.</p>
        content_redaction_type: <p>Redacts all personally identifiable information (PII) identified in your transcript.</p> <p>Content redaction is performed at the segment level; PII specified in <code>PiiEntityTypes</code> is redacted upon complete transcription of an audio segment. If you don't include <code>PiiEntityTypes</code> in your request, all PII is redacted.</p> <p>You can’t set <code>ContentRedactionType</code> and <code>ContentIdentificationType</code> in the same request. If you set both, your request returns a <code>BadRequestException</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html">Redacting or identifying personally identifiable information</a>.</p>
        pii_entity_types: <p>Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can include as many types as you'd like, or you can select <code>ALL</code>.</p> <p>Values must be comma-separated and can include: <code>ADDRESS</code>, <code>BANK_ACCOUNT_NUMBER</code>, <code>BANK_ROUTING</code>, <code>CREDIT_DEBIT_CVV</code>, <code>CREDIT_DEBIT_EXPIRY</code>, <code>CREDIT_DEBIT_NUMBER</code>, <code>EMAIL</code>, <code>NAME</code>, <code>PHONE</code>, <code>PIN</code>, <code>SSN</code>, or <code>ALL</code>.</p> <p>Note that if you include <code>PiiEntityTypes</code> in your request, you must also include <code>ContentIdentificationType</code> or <code>ContentRedactionType</code>.</p> <p>If you include <code>ContentRedactionType</code> or <code>ContentIdentificationType</code> in your request, but do not include <code>PiiEntityTypes</code>, all PII is redacted or identified.</p>

    Raises:
        capo_transcribe_streaming.errors.bad_request_exception.BadRequestException: <p>One or more arguments to the <code>StartStreamTranscription</code>, <code>StartMedicalStreamTranscription</code>, or <code>StartCallAnalyticsStreamTranscription</code> operation was not valid. For example, <code>MediaEncoding</code> or <code>LanguageCode</code> used unsupported values. Check the specified parameters and try your request again.</p>
        capo_transcribe_streaming.errors.conflict_exception.ConflictException: <p>A new stream started with the same session ID. The current stream has been terminated.</p>
        capo_transcribe_streaming.errors.internal_failure_exception.InternalFailureException: <p>A problem occurred while processing the audio. Amazon Transcribe terminated processing.</p>
        capo_transcribe_streaming.errors.limit_exceeded_exception.LimitExceededException: <p>Your client has exceeded one of the Amazon Transcribe limits, typically the concurrent stream service quota. This error can also occur if a stream exceeds the maximum session duration. In rare cases, this error can also occur if you increase your number of concurrent streams too quickly. Reduce your number of concurrent streams and try your request again using an exponential backoff strategy.</p>
        capo_transcribe_streaming.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable. Try your request later.</p>
        capo_transcribe_streaming.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_transcribe_streaming.types.start_call_analytics_stream_transcription_request.StartCallAnalyticsStreamTranscriptionRequest]",
    ) -> AsyncOperationResponse[
        "capo_transcribe_streaming.types.start_call_analytics_stream_transcription_response.StartCallAnalyticsStreamTranscriptionResponse"
    ]:
        import capo_transcribe_streaming._operations.transcribe.start_call_analytics_stream_transcription

        (
            output,
            http_response,
        ) = await capo_transcribe_streaming._operations.transcribe.start_call_analytics_stream_transcription.async_start_call_analytics_stream_transcription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_transcribe_streaming.types.start_call_analytics_stream_transcription_request.StartCallAnalyticsStreamTranscriptionRequest",
    ) -> dict[str, Any]:
        import capo_transcribe_streaming.types.start_call_analytics_stream_transcription_request

        return capo_transcribe_streaming.types.start_call_analytics_stream_transcription_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_transcribe_streaming.types.start_call_analytics_stream_transcription_response.StartCallAnalyticsStreamTranscriptionResponse",
    ) -> dict[str, Any]:
        import capo_transcribe_streaming.types.start_call_analytics_stream_transcription_response

        return capo_transcribe_streaming.types.start_call_analytics_stream_transcription_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartCallAnalyticsStreamTranscription",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_transcribe_streaming.types.start_call_analytics_stream_transcription_request.StartCallAnalyticsStreamTranscriptionRequest = {
        "media_sample_rate_hertz": media_sample_rate_hertz,
        "media_encoding": media_encoding,
        "audio_stream": ensure_async_iterator(audio_stream),
    }
    if language_code is not None:
        input_["language_code"] = language_code
    if vocabulary_name is not None:
        input_["vocabulary_name"] = vocabulary_name
    if session_id is not None:
        input_["session_id"] = session_id
    if vocabulary_filter_name is not None:
        input_["vocabulary_filter_name"] = vocabulary_filter_name
    if vocabulary_filter_method is not None:
        input_["vocabulary_filter_method"] = vocabulary_filter_method
    if language_model_name is not None:
        input_["language_model_name"] = language_model_name
    if identify_language is not None:
        input_["identify_language"] = identify_language
    if language_options is not None:
        input_["language_options"] = language_options
    if preferred_language is not None:
        input_["preferred_language"] = preferred_language
    if vocabulary_names is not None:
        input_["vocabulary_names"] = vocabulary_names
    if vocabulary_filter_names is not None:
        input_["vocabulary_filter_names"] = vocabulary_filter_names
    if enable_partial_results_stabilization is not None:
        input_["enable_partial_results_stabilization"] = (
            enable_partial_results_stabilization
        )
    if partial_results_stability is not None:
        input_["partial_results_stability"] = partial_results_stability
    if content_identification_type is not None:
        input_["content_identification_type"] = content_identification_type
    if content_redaction_type is not None:
        input_["content_redaction_type"] = content_redaction_type
    if pii_entity_types is not None:
        input_["pii_entity_types"] = pii_entity_types

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    try:
        yield response.output
    finally:
        await response.response.aclose()