Streaming Audio from Azure Communication Service Outbound Call to Cognitive Service

Ashley 60 Reputation points
2025-06-12T13:28:09.88+00:00

The objective is to stream audio from an outbound call made with Azure Communication Service to a speech recognizer via WebSocket. The process is designed based on this document and this code.The outbound call has been successfully connected, but an error occurs when attempting to start transcription. The error details are as follows:

[
    {
        'id': 'b83ab652-0ab6-4383-94ad-2c91819d7b1d',
        'source': 'calling/callConnections/23005880-74a4-400f-a7c6-a64021b0eb75',
        'type': 'Microsoft.Communication.TranscriptionFailed',
        'data': {
            'transcriptionUpdate': {
                'transcriptionStatus': 'transcriptionFailed',
                'transcriptionStatusDetails': 'streamUrlMissing'
            },
            'version': '2025-05-15',
            'resultInformation': {
                'code': 400,
                'subCode': 8581,
                'message': 'Action failed, Transport url is not valid or web socket server is not operational.'
            },
            'callConnectionId': '23005880-74a4-400f-a7c6-a64021b0eb75',
            'serverCallId': 'aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzZWEtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi8wXzloRlM4a3NVU0dNemtHY3ZmNzdRP2k9MTAtMTI4LTEyMy0yNDkmZT02Mzg4NTI4MDE4MDU5MDM4Njc=',
            'correlationId': '41926020-8e42-4182-9dcd-bff739751ca1',
            'publicEventType': 'Microsoft.Communication.TranscriptionFailed'
        },
        'time': '2025-06-12T13: 04: 35.4013105+00: 00',
        'specversion': '1.0',
        'datacontenttype': 'application/json',
        'subject': 'calling/callConnections/23005880-74a4-400f-a7c6-a64021b0eb75'
    }
]

Transcription is initiated during the RecognizeCompleted event, and verification shows that the WebSocket is open. Both wss:// and ws:// protocols are yielding the same error. The transcription option set during call_automation_client.create_call is as follows:

transcription_options = TranscriptionOptions(
    transport_url=WEBSOCKET_URI_HOST,
    transport_type=StreamingTransportType.WEBSOCKET,
    locale="en-US",
    start_transcription=True,
    )
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,239 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,301 Reputation points Moderator
    2025-07-01T20:45:50.0466667+00:00

    Hello @Ashley , thanks for your patience. This issue seems to be on your websocket server. Did you validate if that is reachable? Also, it is important to note that ACS only support wss.

    Regarding audio format, it is an option only in audio streaming and not transcription. Version 1.4.0 should have latest changes.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.