From 6e71eaa5e3eb160df2de2ab11e648384e925bd78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lian=20GARCIA?= Date: Tue, 14 Jul 2020 17:20:01 +0200 Subject: [PATCH 1/5] Update README.md --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 38bbc16..7b8a638 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,17 @@ Run milobella in a device, using mic and speakers to communicate. ## Speech-To-Text The translation of voice records into text is currently performed by the [Google Cloud Speech-To-Text API](https://cloud.google.com/speech-to-text). + The [mozilla/deepspeech](https://github.com/mozilla/DeepSpeech) project with Common Voice database is considered. ## Text-To-Speech -The translation of Milobella text answers into speech synthesis is ensured by [Google Cloud Text-To-Speech API](https://cloud.google.com/text-to-speech) +The translation of Milobella text answers into speech synthesis is ensured by [Google Cloud Text-To-Speech API](https://cloud.google.com/text-to-speech). + No replacement has been considered for now. ## Google cloud authentication configuration Authentication process is detailed in this documentation [https://cloud.google.com/speech-to-text/docs/quickstart-protocol]. + It is using basically a ``GOOGLE_APPLICATION_CREDENTIALS`` env variable pointing to a JSON private key file. The JSON private key is generated when you create a Service Account. @@ -23,11 +26,13 @@ Make sure you activated both of the APIs in your Google Cloud Project, and the s The env variable ``MILOBELLA_AUTHORIZATION_TOKEN`` should contain the JWToken generated every time you authenticate. A script ``authenticate.sh`` is here to show you how. (You need [jq](https://stedolan.github.io/jq/download/) if you want to use it) ``` +export MILOBELLA_USERNAME=myuser +export MILOBELLA_PASSWORD=mypass source authenticate.sh ``` ## Raspberry audio configuration -If you are using a Raspberry PI, an example of ``.asoundrc`` is located in this repository. We use plugin to -transform the sample rate to 16GHz. Somehow it works with this configuration. +If you are using a Raspberry PI, an example of ``.asoundrc`` is located in this repository. It is using a plugin to +transform the sample rate to 16GHz. Somehow it works with this configuration ... -The file ``.asoundrc`` needs to be copied in $HOME directory to be effective. +The file ``.asoundrc`` needs to be copied in $HOME directory to be effective, and probably some adjustments are necessary to match the proper card and devices. From a57dc06536e87adad0e5a2bab574e9cdaa656699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lian=20GARCIA?= Date: Tue, 14 Jul 2020 17:24:51 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b8a638..1e3b622 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Run milobella in a device, using mic and speakers to communicate. > Disclaimer : Only checked in a Raspberry PI 3B+ for now. +# Technical choices ## Speech-To-Text The translation of voice records into text is currently performed by the [Google Cloud Speech-To-Text API](https://cloud.google.com/speech-to-text). @@ -14,6 +15,7 @@ The translation of Milobella text answers into speech synthesis is ensured by [G No replacement has been considered for now. +# Requirements ## Google cloud authentication configuration Authentication process is detailed in this documentation [https://cloud.google.com/speech-to-text/docs/quickstart-protocol]. @@ -33,6 +35,19 @@ source authenticate.sh ## Raspberry audio configuration If you are using a Raspberry PI, an example of ``.asoundrc`` is located in this repository. It is using a plugin to -transform the sample rate to 16GHz. Somehow it works with this configuration ... +transform the default sample rate to 16GHz, which is necessary to make work the google cloud speech-to-text. Somehow it works with this configuration ... The file ``.asoundrc`` needs to be copied in $HOME directory to be effective, and probably some adjustments are necessary to match the proper card and devices. + +# Run the program +``` +# Not mandatory but it is always easier to have a virtualenv +python3 -m venv venv +source venv/bin/activate + +# Install requirements +pip install -r requirements.txt + +# Run the app +python milobella.py +``` From 40f8d9c49c8f52c3b772abfbfde794f1e56d8718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lian=20GARCIA?= Date: Tue, 14 Jul 2020 17:25:16 +0200 Subject: [PATCH 3/5] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1e3b622..0940239 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,18 @@ Run milobella in a device, using mic and speakers to communicate. > Disclaimer : Only checked in a Raspberry PI 3B+ for now. # Technical choices -## Speech-To-Text +#### Speech-To-Text The translation of voice records into text is currently performed by the [Google Cloud Speech-To-Text API](https://cloud.google.com/speech-to-text). The [mozilla/deepspeech](https://github.com/mozilla/DeepSpeech) project with Common Voice database is considered. -## Text-To-Speech +#### Text-To-Speech The translation of Milobella text answers into speech synthesis is ensured by [Google Cloud Text-To-Speech API](https://cloud.google.com/text-to-speech). No replacement has been considered for now. # Requirements -## Google cloud authentication configuration +#### Google cloud authentication configuration Authentication process is detailed in this documentation [https://cloud.google.com/speech-to-text/docs/quickstart-protocol]. It is using basically a ``GOOGLE_APPLICATION_CREDENTIALS`` env variable pointing to a JSON private key file. @@ -24,7 +24,7 @@ The JSON private key is generated when you create a Service Account. Make sure you activated both of the APIs in your Google Cloud Project, and the same JSON file will be used. -## Milobella authentication configuration +#### Milobella authentication configuration The env variable ``MILOBELLA_AUTHORIZATION_TOKEN`` should contain the JWToken generated every time you authenticate. A script ``authenticate.sh`` is here to show you how. (You need [jq](https://stedolan.github.io/jq/download/) if you want to use it) ``` @@ -33,7 +33,7 @@ export MILOBELLA_PASSWORD=mypass source authenticate.sh ``` -## Raspberry audio configuration +#### Raspberry audio configuration If you are using a Raspberry PI, an example of ``.asoundrc`` is located in this repository. It is using a plugin to transform the default sample rate to 16GHz, which is necessary to make work the google cloud speech-to-text. Somehow it works with this configuration ... From 36d0eb3f30fbe5c571c09f57657730478e0e9a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lian=20GARCIA?= Date: Tue, 14 Jul 2020 17:26:01 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0940239..b82f63c 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ The file ``.asoundrc`` needs to be copied in $HOME directory to be effective, an # Run the program ``` -# Not mandatory but it is always easier to have a virtualenv +# [If not already in a venv] Not mandatory but it is always easier to have a virtualenv python3 -m venv venv source venv/bin/activate From 8de201c2df51a0c3067964154f86c875d1b3160e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lian=20GARCIA?= Date: Tue, 14 Jul 2020 17:26:49 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b82f63c..8a7044f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ No replacement has been considered for now. # Requirements #### Google cloud authentication configuration -Authentication process is detailed in this documentation [https://cloud.google.com/speech-to-text/docs/quickstart-protocol]. +Authentication process is detailed in this documentation https://cloud.google.com/speech-to-text/docs/quickstart-protocol. It is using basically a ``GOOGLE_APPLICATION_CREDENTIALS`` env variable pointing to a JSON private key file. The JSON private key is generated when you create a Service Account.