Page 1 of 1

Voice Sound Pack Generator - Mac OSX

Posted: Fri Mar 27, 2015 4:35 pm
by AustinSaintAubin
This is a OpenTX - Voice Sound Pack Generator for Mac OSX. (Could also work on linux with some modification to the script)
This generator uses the "say" command that is built into Mac OS X.
The current configuration of the script uses the Samantha voice, same voice as Siri on the iOS devices (Siri on you OpenTX Transmitter).

Instructions all resources are included in the OpenTX 2.x - Voice and Sound Pack Generator - Definitions by AustinSaintAubin, also in the OpenTX 2.x - Voice and Sound Pack Generator - Official OpenTX Definitions.

Re: [OPENTX] Voice Sound Pack Generator - Mac OSX

Posted: Fri Mar 27, 2015 5:41 pm
by Kilrah
This is cool!
What are the "red" categories that are not currently selected in the spreadsheets? Simply some that are not made yet?

We recently added a few units for next 2.1 release, I can add them if you give me write access (request sent) :)

Can I put a link to it on open-tx.org?

Re: [OPENTX] Voice Sound Pack Generator - Mac OSX

Posted: Fri Mar 27, 2015 6:30 pm
by AustinSaintAubin
The items in red are what is NOT included based on current selection, you can change your selection in the drop down list at the top of the MAIN tab.
This allows you to quickly exclude or include certain categories into your sound pack.
This makes for a very dynamic sound pack build.
From start to finish it takes me about 3 minutes to build a complete sound pack from scratch, including compile time.
Makes for a quick solution for adding and editing sounds.

Please PM or Email me and I will give you editing ability on the doc. It needs some editing.
I would love to see this on the open-tx.org site.


I might make a video showing how to use the system.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Sun Jul 05, 2015 12:59 pm
by Kilrah
I have made a copy of the definition file and adapted it for OpenTX 2.1 as there have been some changes in the numbering of system files:
https://docs.google.com/spreadsheets/d/ ... sp=sharing

I made the copy a while ago and haven't checked for changes in other tabs since.

Envoyé de mon SM-G920F en utilisant Tapatalk

Re: Voice Sound Pack Generator - Mac OSX

Posted: Wed Jul 15, 2015 5:00 pm
by AustinSaintAubin
Kilrah wrote:I have made a copy of the definition file and adapted it for OpenTX 2.1 as there have been some changes in the numbering of system files:
https://docs.google.com/spreadsheets/d/ ... sp=sharing

I made the copy a while ago and haven't checked for changes in other tabs since.

Envoyé de mon SM-G920F en utilisant Tapatalk
I have updated your OpenTX 2.x - Voice and Sound Pack Generator - Official OpenTX Definitions and my OpenTX 2.x - Voice and Sound Pack Generator - Definitions by AustinSaintAubin with the latest info and fixed a few minor issues with opentx_voice_and_sound_pack_generator_script_mac-osx.sh.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Fri Aug 07, 2015 8:53 am
by rguptaca
Great Job!
Suggestions/Requests
- update instruction 3 - I had to make a copy of the document and then make changes
- could you provide an instruction tab as the first and default tab in the file?
- could your first post be kept updated with the current files to use plus add dates on when they were updated last; saves having to read the thread to find files such as the Copy of OpenTx....
- could the script be updated to
search for *OpenTx*.csv
or maybe script followed by file name to use as an option
sh script.sh anffilename.csv

Re: Voice Sound Pack Generator - Mac OSX

Posted: Tue Sep 15, 2015 3:58 am
by AustinSaintAubin
rguptaca wrote:Great Job!
Suggestions/Requests
- update instruction 3 - I had to make a copy of the document and then make changes
- could you provide an instruction tab as the first and default tab in the file?
- could your first post be kept updated with the current files to use plus add dates on when they were updated last; saves having to read the thread to find files such as the Copy of OpenTx....
- could the script be updated to
search for *OpenTx*.csv
or maybe script followed by file name to use as an option
sh script.sh anffilename.csv
Sorry it took me so long to post a reply to your suggestions. They really are good suggestions.
I have made all the following changes you requested / suggestion. I feel that with your suggestions the quality of this project is much better.
I have made a lot of edits to the instructions in the Google document, I've also set those instructions to the first page of the documen.
I have updated the script to look for "OpenTx(*Wildcard*).csv"

Re: Voice Sound Pack Generator - Mac OSX

Posted: Tue Sep 15, 2015 3:47 pm
by rguptaca
:D Cool.... I took your script, figured out how it worked and wrote the following. This way I can do quick single voices files.

#!/bin/sh

#find . -name "*.aiff" -exec afconvert -f WAVE -d LEI16@32000 -c 1 {} \;

FILEOUT=$1.aiff
PHRASE=$2
VOICE=Tessa

clear

if [ “$2” == “” ]; then
echo
echo Usage:
echo \ \ \ \ \ $0 file phrase
echo \ \ \ \ \ \ \ file - Desired file name without extension
echo \ \ \ \ \ \ \ phrase - “Text to be converted to speech”
echo
echo Example:
echo \ \ \ \ \ $0 test \”this is a test\””
echo \ \ \ \ \ \ \ A file test.wav will be created.
echo
else
# Create Voice File
say -v $VOICE $PHRASE -o $FILEOUT

# Convert AIFF to WAV
afconvert -f WAVE -d LEI16@32000 -c 1 $FILEOUT

# Remove unneeded AIFF voice voice file
rm $FILEOUT
fi

Re: Voice Sound Pack Generator - Mac OSX

Posted: Sun Jan 24, 2016 4:11 pm
by Sparky
Not work for me...

Code: Select all

iMac-Hackintosh:Sound Taranis Mac HaMac$ sh /Users/HaMac/Desktop/Sound\ Taranis\ Mac/opentx_voice_and_sound_pack_generator_script_mac-osx.sh 
usage: dirname path
ls: /OpenTX*.csv: No such file or directory
===========================
OpenTX Voice Sound Pack Generator - Mac OSX - v1.2 - 2015/07/15 - Written By: Austin St. Aubin ([email protected]) 
   ∟ Description: Description: Creates phrases with macs osx's built in say command based on cvs file.
~ - - - - - - - - - - - - ~
Destination Directory: /SOUNDS
Source File: 
~ - - - - - - - - - - - - ~
Hello, my name is Samantha, I would create your sound pack but I can't find the source file needed to create it. Please check your configuration in the script, and the title of your source file.
iMac-Hackintosh:Sound Taranis Mac HaMac$ 

Re: Voice Sound Pack Generator - Mac OSX

Posted: Tue Jan 26, 2016 5:04 pm
by AustinSaintAubin
Sparky wrote:Not work for me...

Code: Select all

iMac-Hackintosh:Sound Taranis Mac HaMac$ sh /Users/HaMac/Desktop/Sound\ Taranis\ Mac/opentx_voice_and_sound_pack_generator_script_mac-osx.sh 
usage: dirname path
ls: /OpenTX*.csv: No such file or directory
===========================
OpenTX Voice Sound Pack Generator - Mac OSX - v1.2 - 2015/07/15 - Written By: Austin St. Aubin ([email protected]) 
   ∟ Description: Description: Creates phrases with macs osx's built in say command based on cvs file.
~ - - - - - - - - - - - - ~
Destination Directory: /SOUNDS
Source File: 
~ - - - - - - - - - - - - ~
Hello, my name is Samantha, I would create your sound pack but I can't find the source file needed to create it. Please check your configuration in the script, and the title of your source file.
iMac-Hackintosh:Sound Taranis Mac HaMac$ 
Looks like the source directory is not being located. Looks like "$(dirname $0)" is not working correctly for you... Ah figured it out.
I did not encapsulate my "$(dirname $0)".... should be like this "$(dirname "$0")" with quotes around the "$0" so that the spaces in file names are not passed as additional parameters to dirname. I also had a few other encapsulation issues that I fixed.

In layman's terms... my script had a bug. I have fixed it, download the latest version [v1.3] (same link as in Google Docs), and run it. (also thanks for your post, let me know if the latest version works for you)

Re: Voice Sound Pack Generator - Mac OSX

Posted: Sun Aug 14, 2016 1:09 am
by sendwaves
Thanks for sharing the script and spreadsheet. It brought a smile to my face when I was able to generate all of the OpenTx voice tracks with the voice on the Mac that was most pleasing to me.

I'd like to suggest a couple of small improvements to the script in order to generate the model name files.

First, the regex on line 90 that checks directory names won't work for model names that contain capital letters other than "A" or contain a space. I'm guessing this is inadvertent.

Code: Select all

if [ -n "$directory" ] && [ -n "$file_name" ] && [ -n "$phrase" ] && [[ "$directory" =~ ^[a-zA-A]{2}(\/[a-zA-A1-9]+)?$ ]]; then
I changed the regex to allow capital letters A-Z and the "_", which OpenTx uses when the model name has a space:

Code: Select all

if [ -n "$directory" ] && [ -n "$file_name" ] && [ -n "$phrase" ] && [[ "$directory" =~ ^[a-zA-Z]{2}(\/[a-zA-Z1-9_]+)?$ ]]; then
Second, I wanted to generate just the model names and not the entire set of voice files again, so I changed how the SOURCE_FILE variable is initialized to allow it to be overridden with the first positional parameter on the command line, like so:

Code: Select all

./opentx_voice_and_sound_pack_generator_script_mac-osx.sh modelnames.csv
If you do not specify any positional parameters, it uses the default file name produced by the Download As CSV step in the instructions. The modified definition of SOURCE_FILE looks like this:

Code: Select all

DEFAULT_SOURCE_FILE=$(ls "$SOURCE_DIRECTORY"/OpenTX*.csv)
SOURCE_FILE=${1:-$DEFAULT_SOURCE_FILE} # CSV File with the phrases & file names.
It may also be a good idea to remove what appear to be spurious entries in the model_name tab of the spreadsheet and add a few details to the instructions that will help people successfully generate model name sound files.

For example, if my model is named "Alula", then OpenTx will try to load the name from the file "SOUNDS/en/Alula/name.wav". In the model_name tab on the spreadsheet, I would enter "en/Alula" in the directory column.

If my model name contains a space, like "Flip 3D", then I would need to enter "en/Flip_3D" in the directory column since OpenTx substitutes a "_" for the space in the name.

The name column is the same for all models, "name".

I'm using OpenTx 2.1.8. Maybe this also applies to earlier versions?

As an aside, to get the pronunciation I wanted for the Alula, I used "a lu la" as the phrase. It helps to experiment with the "say" command...

Re: Voice Sound Pack Generator - Mac OSX

Posted: Thu Aug 18, 2016 1:39 pm
by AustinSaintAubin
Thank you sendwaves for your recommendations, and for catching my typo in regular expression.
I have updated the script with your suggestions.

I will work on the model sheet in the spreadsheet soon.
Thanks again.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Mon Feb 06, 2017 3:18 pm
by TReu
Are there any plans to make this really wonderful script compatible to OpenTX ver2.2.x? Is there even documentation about HOW the file naming for the voice pack sound files has changed? On the release page it just states, that none of the older voice packs will work.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Mon Feb 06, 2017 4:59 pm
by Kilrah
Both the old and new packs include a .csv file with the list of phrases and names, not too hard to figure out the changes.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Tue Feb 07, 2017 1:21 am
by AustinSaintAubin

Re: Voice Sound Pack Generator - Mac OSX

Posted: Mon Feb 20, 2017 8:32 am
by TReu
Yes! Thanks so much!

Re: Voice Sound Pack Generator - Mac OSX

Posted: Sat Jan 12, 2019 5:16 pm
by AustinSaintAubin
Updated for OpenTX 2.2.3 w/ sdcard-taranis-x9-2.2V0018

Re: Voice Sound Pack Generator - Mac OSX

Posted: Fri May 03, 2019 12:29 pm
by jhsa
You need an audio mixer :)

João

Re: Voice Sound Pack Generator - Mac OSX

Posted: Thu May 23, 2019 8:19 pm
by destroix
The items in red are what is NOT included based on current selection, you can change your selection in the drop down list at the top of the MAIN tab.
This allows you to quickly exclude or include certain categories into your sound pack.
This makes for a very dynamic sound pack build.
From start to finish it takes me about 3 minutes to build a complete sound pack from scratch, including compile time.
Makes for a quick solution for adding and editing sounds.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Sun Jun 02, 2019 5:49 pm
by kjtemmes
Hi.
AustinSaintAubin could you pls give permission to edit that google sheet to do some custom sounds to my x10s.
Thank you.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Thu Aug 15, 2019 11:33 am
by SoaringPhil
Hello AustinSaintAubin - I just played around with your script, added my own sound files and removed some I would not use. It's a fantastic tool, I love it. It allows to have just those sound files you need and to easily tweek some if needed/wanted. Many thanks for sharing.

I also saw, that some sound files do have a name consisting of 7 digits plus extension. Do you have a new spreadsheet with the OpenTX 2.2+ naming convention(6 digits plus extension)? Or am I missing a point?

Re: Voice Sound Pack Generator - Mac OSX

Posted: Sat Jan 01, 2022 5:43 pm
by AustinSaintAubin
kjtemmes wrote: Sun Jun 02, 2019 5:49 pm Hi.
AustinSaintAubin could you pls give permission to edit that google sheet to do some custom sounds to my x10s.
Thank you.
Permissions fixes in google drive. Looks like Google update changed the way links worked. Sorry for getting to this so late.

Re: Voice Sound Pack Generator - Mac OSX

Posted: Thu Feb 03, 2022 1:23 pm
by vikassmallik
Hi,
Here is a sound pack created by me. If anyone wants can download from below link:
https://1drv.ms/u/s!AvU5GcV1jhEsbe2iOhj ... U?e=Dy3dbm

thanks