Skip to content

Commit

Permalink
gemi (docker): install mbrola for more voices
Browse files Browse the repository at this point in the history
  • Loading branch information
Akash98Sky committed Jan 13, 2024
1 parent e40a6c4 commit 4a26d66
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.github/**
.space/**
.vscode/**

.spaceignore
.gitignore
Spacefile
.env
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ cython_debug/
#.idea/

# Testing purpose
test.*
test*.*

# Temporary files.
temp/voice_*.*
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Use an official Python runtime as a parent image
FROM python:3.11-slim
FROM --platform=linux/amd64 python:3.11-slim

RUN apt-get update && apt-get install -y git python3-pyaudio espeak ffmpeg
RUN echo 'deb http://deb.debian.org/debian stable main contrib' > /etc/apt/sources.list
RUN apt-get update && apt-get install -y git wget espeak ffmpeg mbrola
RUN mkdir -p /usr/share/mbrola/us1
RUN wget https://github.com/numediart/MBROLA-voices/raw/master/data/us1/us1 -O /usr/share/mbrola/us1/us1
RUN wget https://github.com/numediart/MBROLA-voices/raw/master/data/us1/us1mrpa -O /usr/share/mbrola/us1/us1mrpa

# Set the working directory in the container
WORKDIR /usr/src/app
WORKDIR /app

# Copy the current directory contents into the container at /usr/src/app
# Copy the current directory contents into the container at /app
COPY . .

# Install any needed packages specified in requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions chat/query_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class QueryProcessor():
def __init__(self, service: ChatService):
self.__service = service
self.__voice_engine = pyttsx3.init()
self.__voice_engine.setProperty('voice', self.__voice_engine.getProperty('voices')[1].id)
self.__voice_engine.setProperty('rate', 140)
self.__voice_engine.setProperty('voice', 'mb-us1')
self.__voice_engine.setProperty('rate', 100)

async def __process_searchengine_query__(self, query: str):
async with AsyncDDGS() as ddgs:
Expand Down

0 comments on commit 4a26d66

Please sign in to comment.