Search code examples
pythonaws-lambdaazure-devopsdocker-imageazure-speech

azure-cognitiveservices-speech api error while using with AWS Lambda


I am trying to use Microsoft speech to text api(azure-cognitiveservices-speech) in AWS Lambda. In AWS Lambda I am using docker image(public.ecr.aws/lambda/python:3.8). when I run the the code I am getting the following error:

Speech Recognition canceled: CancellationReason.Error
Error details: Runtime error: Failed to initialize platform (azure-c-shared)

I tried to solve issue by following https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-sdk?tabs=linux%2Crhel-centos%2Cios-xcode%2Cmac-xcode%2Candroid-studio#get-the-speech-sdk But still getting the same error


Solution

  • I have solved this issue by using ubuntu base customer docker image. The issue was with lambda docker base image as this does not support Azure SKD(azure-cognitiveservices-speech). So I use custom docker image. For ref I am sharing GitHub link of my custom docker image - Github 1https://github.com/Ravisiswaliya/azure_speech_to_text_with_aws_lambda