Dleay of 3-4 seconds for play_media action (ACS CallAutomation) -SDK - Python

Ghaith Rawi 0 Reputation points
2024-04-08T01:49:21.99+00:00

Hi All,

 

We are trying to build a contact centre solution and part of it is to play IVR prompts to callers.

 

I was trying to simulate playing prompts to caller with a simple code just to play media file to caller once the call is 'Connected'. After that, another media file is played to the caller upon the first promp is in 'Microsoft.Communication.PlayCompleted' state.

 

However, What I noticed is when the call is connected, it takes around 2-3 seconds for the first media file to be played. And once the 'PlayCompleted' event is triggered it takes another 2-3 seconds for the second media file to be played. So basically, there is a delay of 3 seconds (caller hears silence) for every media file we play to them.

 

I enabled caching on the Filesource object and made a couple of test calls but that didnt help at all.

 

 bellow is a snippet of my code.

 

if event['type'] == 'Microsoft.Communication.CallConnected': media='https://contactcentredata.blob.core.windows.net/prompts/welcome_msg.wav' my_file = FileSource(url=media,play_source_cache_id='media1') logging.warning(f'Start playing at = {datetime. now()}') callConnectionClient.play_media(play_source=my_file)

 

------------------------------------------------------------------- elif event['type'] == 'Microsoft.Communication.PlayCompleted': media2 = 'https://contactcentredata.blob.core.windows.net/prompts/welcome_msg2.wav' my_file2 = FileSource(url=media2,play_source_cache_id='media2') logging.warning(f'Start playing at = {datetime. now()}') callConnectionClient.play_media(play_source=my_file2)

 

I noticed some people raised that when using the Cognitive service to play Text -to-speech but there is no response yet as of how to fix this problem.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
684 questions
{count} votes