how to resolve question with error_code 0x8 (SPXERR_FILE_OPEN_FAILED) at my mac

george kristen 5 Reputation points
2023-04-18T03:38:05.37+00:00

i follow the step with such address:https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-speech-synthesis?tabs=browserjs%2Cterminal&pivots=programming-language-java and i use the demo code like this and i alse set speechKey and speechRegion at my env file:~/.source_profile but i got a exception while run this code:[Exception with an error code: 0x8 (SPXERR_FILE_OPEN_FAILED)] how could i resolve this exception cause i follow step by step thanks


 private static void customSynthesisSpeech(){

        SpeechConfig speechConfig = SpeechConfig.fromSubscription(speechKey,speechRegion);

        speechConfig.setSpeechSynthesisLanguage("en-US");

        speechConfig.setSpeechSynthesisVoiceName("en-US-JennyNeural");



        AudioConfig audioConfig = AudioConfig.fromWavFileOutput("~/a.wav");

        SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer(speechConfig,audioConfig);

        speechSynthesizer.SpeakText("i want a cup coffee with more sugar");

    }
Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,813 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,957 questions
{count} vote

1 answer

Sort by: Most helpful
  1. van der Laan, Pepijn 0 Reputation points
    2023-08-27T12:02:08.8033333+00:00

    I´d like to flag that I have a similar issue.

    I run de speech SDK in a docker container.

    • If I run the container locally, it works swell.
    • If I deploy the container as an Azure webapp the speechsdk fails with this Exception in the Webapplog:
    Exception with an error code: 0x8 (SPXERR_FILE_OPEN_FAILED)
    
    

    This shouldn't make a difference, though. Or could it?

    My Dockerfile:

    FROM python:3.10-slim AS baseimage
    
    ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
    
    RUN apt-get update -q && \
        apt-get install -q -y --no-install-recommends \
        wget \ 
        ffmpeg \
        libavcodec-extra
    
    # Roll back to openssl 1.1.1
    RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb \
        && dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
    
    RUN apt-get clean \
        && rm -rf /var/lib/apt/lists/*
    
    FROM baseimage AS deploycontainer
    
    COPY requirements.txt /requirements.txt 
    
    RUN pip install -r /requirements.txt
    
    ADD . /uploadapp/
    WORKDIR /uploadapp
    
    EXPOSE 8000
    
    ENTRYPOINT ["gunicorn", "app:app"]
    
    
    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.