Share via

Issue in connecting ACS (Azure Communication Services) with Azure Cognitive Service

Kumar, Kiran 0 Reputation points
2025-09-05T12:17:16.7+00:00

Hello Azure Community,

We're currently working on integrating Azure Cognitive Services (Speech Services) with Azure Communication Services (ACS), but we've hit a roadblock and could use some guidance.

Goal: Our main objective is to route Speech Services through ACS so that synthesized speech can be played during PSTN calls.

What we've tried so far:

  • ACS Integration: Using ASP.NET and the ACS SDKs, we successfully initiated a PSTN call and played a publicly hosted .wav audio file. So ACS seems to be functioning correctly on its own.
  • Speech Services Test: We tested Speech Services separately using the SpeechConfig and SpeechSynthesizer methods, providing the correct key and region. It successfully synthesized and able to create an audio file with public access without any authorization "Hello, this is a Test Message".

Issue: When attempting to route Speech Services with methods
*
var callMedia = callConnection.GetCallMedia();*

                               var textSource = new TextSource("Hello, this is your ACS bot speaking!")

                               {

                                   VoiceName = "en-US-AriaNeural",

                                   SourceLocale = "en-US"

                               };

                               var audioUri = new Uri("https://basuri_of_Azure/audio/greeting.w…

                               var fileSource = new FileSource(audioUri);

                               var playResult = await callMedia.PlayToAllAsync(fileSource);

                               var result = await callMedia.PlayToAllAsync(textSource);

through ACS, we encountered an error with subcode 8565. Despite both services working independently, the integration isn't functioning as expected.

Request for Help: Has anyone successfully routed Speech Services through ACS for PSTN scenarios? Any insights on the 8565 error or best practices for this integration would be greatly appreciated!

Thanks in advance for your support! — Looking forward to learning from this amazing community.

Azure Communication Services

1 answer

Sort by: Most helpful
  1. Praneeth Maddali 9,515 Reputation points Microsoft External Staff Moderator
    2025-09-09T06:09:11.0333333+00:00

    Hi @Kumar, Kiran

    Thank you for informing us about the issue you're experiencing when connecting Azure Communication Services (ACS) with Azure AI Services to use text-to-speech (TTS) during calls. I understand you're seeing an error (subcode 8565) when combining these services, despite each working individually. This problem is often related to permissions, incorrect voice settings, service limits, or recent changes in integration. Please follow the steps below

    Step 1: Check Permissions for ACS The error might mean ACS isn’t allowed to talk to your Azure AI Services resource.

    • Go to the Azure Portal
    • Find your ACS resource, click Identity on the left, and turn on System assigned (set it to On and click Save).
    • Now go to your Azure AI Services resource (it needs to be a “Multi-service” type, not just Speech).
    • Click Access control (IAM), then Add > Add role assignment.
    • Pick Cognitive Services User, select your ACS resource’s managed identity, and click Review + assign.
    • Or, in your ACS resource, go to the Cognitive Services tab, click Connect cognitive service, choose your Azure AI Services resource, and hit Connect.
    • Give it 5-10 minutes, then test again.

    Step 2: Double-Check Your Voice Settings If the voice in your code isn’t set up right, it can cause this error.

    • Your code uses “en-US-AriaNeural,” which is usually fine. Just make sure it works with your region and plan.
    • Here’s an example of your code (C#):
    var callMedia = callConnection.GetCallMedia();
    var textSource = new TextSource("Hello, this is your ACS bot speaking!")
    {
        VoiceName = "en-US-AriaNeural",
        SourceLocale = "en-US"
    };
    var playResult = await callMedia.PlayToAllAsync(textSource);
    
    
    • If it doesn’t work, try a different voice like “en-US-JennyNeural” or use SSML for more options:
    
    var ssmlSource = new SsmlSource("<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xml:lang='en-US'><voice name='en-US-JennyNeural'>Hello, this is your ACS bot speaking!</voice></speak>");
    var playResult = await callMedia.PlayToAllAsync(ssmlSource);
    
    

    You can see all available voices in Speech Studio (speech.microsoft.com/portal/voicegallery)

    Step 3: Look at Your Plan’s Limits If you’re using a free Azure AI Services plan, you might have hit a limit on how much TTS you can use.

    • In the Azure Portal, go to your Azure AI Services resource > Properties > Quota limits.
    • Check if you’ve used up your TTS limit (free plans allow about 0.5 million characters per month).
    • If you’re out of quota, switch to a paid plan
    • Go to Pricing tier, choose Standard S0, and click Apply.
    • If you still hit limits, ask for a quota increase in Azure Portal > Support + troubleshooting > New support request.

    Step 4: Make Sure You’re Using the Right Resource The way ACS and Azure AI Services work together changed after moving from a test (preview) phase to public use. You need a Multi-service Azure AI Services resource, not a Speech-only one.

    • Check your Azure AI Services resource in the Azure Portal > Properties. It should say “Multi-service account.”
    • If it’s not, create a new one:
    • Search for “Azure AI services,” click Create, pick Multi-service account, and set it up in a supported region (like East US or West Europe).
    • Update the connection in Step 1 to use this new resource.
    • Make sure your ACS and Azure AI Services are in matching regions (check the integration guide below).

    Step 5: Test and Check for Errors

    • Restart your app or redeploy it to apply the changes.
    • Make a test phone call to see if the TTS audio plays.
    • If the error still shows up, check ACS logs:
      • Go to your ACS resource > Monitoring > Logs.
      • Look for “PlayFailed” or “PlayCompleted” to see what’s going wrong.
    • If you need more help, please share:
      • The full error message from the logs.
      • The regions of your ACS and Azure AI Services resources.
      • Whether your Azure AI Services is a Multi-service type.
      • If you’re on a free or paid plan.

    Microsoft reference:
    How to Connect ACS to Azure AI Services: https://learn.microsoft.com/en-us/azure/communication-services/concepts/call-automation/azure-communication-services-azure-cognitive-services-integration
    How to Fix ACS Errors: https://learn.microsoft.com/en-us/azure/communication-services/resources/troubleshooting/voice-video-calling/troubleshooting-codes?pivots=calling
    https://learn.microsoft.com/en-us/azure/communication-services/how-tos/call-automation/play-action?pivots=programming-language-javascript
    https://learn.microsoft.com/en-us/azure/ai-services/speech-service/text-to-speech

    https://azure.microsoft.com/en-us/pricing/details/cognitive-services/

    Kindly let us know if the above helps or you need further assistance on this issue.

     

    Please "upvote" if the information helped you. This will help us and others in the community as well.

    Best Regards,
    Praneeth Maddali

    Was this answer helpful?

    0 comments No comments

Your answer

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