depau / SAPISpeechServer

Simple REST server that exposes Windows' TTS Speech API. This should also work on Wine.
MIT License
6 stars 0 forks source link

About adding language packs to Docker #1

Closed xeden3 closed 5 months ago

xeden3 commented 5 months ago

Thank you very much for the MSSpeechServer code you provided, especially the docker image. This is a very good solution for implementing TTS under Linux. Other deep learning solutions require GPU or are too slow.  But this Docker Image only provides English. Looking at the container, I found that it uses Microsoft Speech SDK 5.1. If I understand correctly, this can only use older language packs, but not the Speech Language V11 language pack. This is how I understand it. Correct?  The address of the SDK5.1 language pack (only Japanese and Chinese extensions) https://www.microsoft.com/en-us/download/details.aspx?id=10121  Download address of SDK11 language pack https://www.microsoft.com/en-us/download/details.aspx?id=27224  Secondly, when using the code you provide to do language extensions

FROM ghcr.io/depau/sapispeechserver

COPY Setup.exe /tmp/Setup.exe
COPY Setup.msi /tmp/Setup.msi

RUN source auto_xvfb && \
#InnoSetup
wine /tmp/Setup.exe /VERYSILENT /SUPPRESSMSGBOXES && \
#MSI
wine msiexec /qn /i /tmp/Setup.msi && \
# Wait for Wine to shut down
echo "Waiting for all Windows tasks to complete..." && \
wineserver-w

 Are the Setup.exe and Setup.msi inside the files decompressed by SpeechSDK51LangPack.exe?  Finally, when I was building, the following error occurred.

image

I think the Setup.exe and Setup.msi files I used were incorrect.  Looking forward to your answer  Thank you so much

depau commented 5 months ago

Hi, Unfortunately using wine headlessly isn't simple. Currently I don't have a lot of free time to help you out installing the voices, but I can give you some tips to help you troubleshoot it yourself.

I recommend you test the voices on Windows first to make sure they work. You can use the balcon.exe utility to test the voices: https://stackoverflow.com/a/45569850/1124621

Once you figured out which files are the correct ones, try installing them on Wine first without Docker.

# force 32-bit Windows emulation
export WINEARCH=win32

# use a fresh wine prefix in the current folder
export WINEPREFIX="$PWD/wine-sapi-test"

# Install the speech API
winetricks win10 nocrashdialog dotnet6 speechsdk
winetricks win10

Then from within the same terminal on which you set the environment variables using export, run the installers:

wine setup.exe               # for .exe installers
wine msiexec /i setup.msi    # for .msi installers

The balcon.exe utility should work on Wine as well, just run wine balcon.exe ....

Once you figured out how to install the voices appropriately you need to figure out how to run the voice installer quietly so it runs from within Docker. For MSI this is trivial, just do what I say in the readme. For the EXE you need to figure it out yourself, let me know if you need help.

xeden3 commented 5 months ago

Thank you very much for your assistance.

Although I attempted to utilize the MS-Speech-SDK5.1 SAPI5 approach and experimented with various executable language packs, none could be installed successfully.

I suspect that interactive interface is required, making silent installation impossible.

Therefore, I have opted for an alternative approach using the Microsoft speech platform - runtime languages (version 11),

https://www.microsoft.com/en-us/download/details.aspx?id=27224

invoking it through C# .NET 4.6. I have redeveloped the code to accommodate support for multiple languages.

Project home page https://github.com/xeden3/MSSpeechServer/

Once again, I greatly appreciate your assistance and the support of your project's code.

depau commented 5 months ago

I'm glad you figured it out!

Since you used code from this repository for setting up Wine and Docker I'd appreciate some credits :)