python – How can I add ffmpeg file or directory in aws lambda functions?

I am encountering an error when running a Lambda function that merges audio chunks into a single audio file using Python 3.10.

The error message is:
No such file or directory: 'ffmpeg'

def create_combined_audio_from_chunks(sorted_objects_key_list):

    # Create an empty AudioSegment object to hold the combined audio
    combined_audio = AudioSegment.empty()
    
    for key in sorted_objects_key_list:
        try:
            file_content = get_s3_object_content(object_key=key)
    
            with tempfile.NamedTemporaryFile(delete=True) as temp_file:
                temp_file.write(file_content)
                temp_file.seek(0)
    
                sound = AudioSegment.from_file_using_temporary_files(temp_file)
    
            combined_audio += sound
            
        except Exception as e:
            print(e)
    
    return combined_audio

I am encountering an error when running a Lambda function that merges audio chunks into a single audio file using Python 3.10.

Read more here: Source link