- Notifications
You must be signed in to change notification settings - Fork0
🗣 Auto-generate dialog audio files using the Replica Studios 'AI Voices' API using Rasa's responses.yml file format.
License
bfackland/replica_dialog_generator
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Auto-generate dialog audio files using the Replica Studios 'AI Voices' APIusing Rasa's responses.yml file format.
You want to generate audio files for the text dialog you are using in yourcreative chatbot project, so that your code can 'speak', in a 'realistic',perhaps even unique voice, to the end-user.
You can use this utility standalone, or within a Rasa project folder.
To quotetheir website:
AI voice actors for games + films
It all starts with a talented voice actor spending hours training our AI howto perform.Our AI model learns how to perform by copying the real voice actors uniquespeech patterns, pronunciation, and emotional range.The end result is an AI voice actor you can use in your games or films.
To quotetheir website:
Rasa is the leading conversational AI platform, for personalizedconversations at scale.
Rasa Open Source is a framework for natural language understanding,dialogue management, and integrations. Rasa X is a free toolset used toimprove virtual assistants built using Rasa Open Source. Together, theyinclude all the features to create powerful text- and voice-based assistantsand chatbots.
This utility is distributed under GNU General Public License v3.0,which can be found in the file LICENCE.txt. In summary:
Permissions of this strong copyleft license are conditioned on makingavailable complete source code of licensed works and modifications,which include larger works using a licensed work, under the same license.Copyright and license notices must be preserved.Contributors provide an express grant of patent rights.
First you'll need an account with Replica Studios. As of July 2021 you get30 minutes of free credit when you sign up. If you use the following referrallink, you get 60 minutes:
https://replicastudios.com/account/signup?referral_code=Xe07Evdx
Once you have an active account, put your credentials in a local file so thatthe dialog generation script can authenticate you against the API:
# replica_api_credentials.json{ "client_id" : "<your replica username>", "secret" : "<your replica password>"}
(Note:replica_api_credentials.json
should not be added or pushed to aGit repo and is ignored in.gitignore
by default.)
Next you'll need to specify the name and Replica UID of a voice to generateaudio files with. Here's an example:
# replica_config.json{ "replica_voice_uids" : { "amber" : "4807ea95-5b17-43b7-b25d-e409736a099f", "thomas" : "c7c81053-7ac3-4b2f-9809-0be6fae07ca5" }}
At the time of writing (July 2021) it only seems possible to obtain the UIDby viewing the source of the Replica website Project page when selectinga voice.
You'll need adialog
folder and aresponses.yml
file in your current/projectfolder, defining the dialog to be generated:
mkdir dialog
Here's a simple exampleresponses.yml
taken from theRasa v2 documentation:
# ./dialog/responses.yml---version: "2.0"responses: utter_greet: - text: "Hi there!" utter_bye: - text: "See you!"
Now create a Pythonvirtual environment (venv) andinstall the package dependencies defined inrequirements.txt
:
python3 -m venv ./venvsource ./venv/bin/activatepip3 install -r requirements.txt
If you've made it this far you should now be able to rungenerate_dialog.py
which will work through all the dialog in./dialog/responses.yml
and attemptto generate OGG audio files for each (using thefirst voice you specify inreplica_config.json
):
python generate_dialog.py
Problem:ModuleNotFoundError
, e.g. for 'requests':
% python generate_dialog.pyTraceback (most recent call last): File "generate_dialog.py", line 1, in <module> import requestsModuleNotFoundError: No module named 'requests'
Solution: Make sure you've installed the depdendencies using pip3 (as above),then (re-)activated your venv prior to running:
source ./venv/bin/activatepython generate_dialog.py
Found a bug? Consider raising an Issue:
- check whether the same or similar issue has been reported under theGitHubIssuestab
- if not,submit a new issueand label it with 'bug' or similar.
This should notify contributors who can investigate and will typically respondon the issue, notifying you in the process.
If you would like to add a new feature orfix an existing bugplease feel free!
Here's a summary of the process you should follow:
ensure an Issue exists that describes what you will work on and why; if not,submit a new issueand label it with 'bug' or similar;
create a new branch of this repository (repo) which will contain theimplementation of your contribution, with the issue number in the branch name,e.g.:
git checkout -b 123-name-of-your-new-branch
(where '123' is the issue number);
- once you are happy with the changes you made in yourlocal codebase,push them to the GitHub repo:
git add .git commit -m "fixed a bug"git push origin 123-name-of-your-new-branch
- open aPull Requeston GitHub for your new branch using the"New pull request" button; add in a title and a comment describing what youhave done, then press the "Create pull request" button.
This should notify the project owner who can initiate a review and communicatewith you via GitHub.
About
🗣 Auto-generate dialog audio files using the Replica Studios 'AI Voices' API using Rasa's responses.yml file format.
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Uh oh!
There was an error while loading.Please reload this page.