Voice Sound Pack Generator - Mac OSX

Sound packs for the new audio mods
Post Reply
User avatar
AustinSaintAubin
Posts: 7
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin » Fri Mar 27, 2015 4:35 pm

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.
Last edited by AustinSaintAubin on Tue Sep 15, 2015 4:13 am, edited 5 times in total.

User avatar
Kilrah
Posts: 8763
Joined: Sat Feb 18, 2012 6:56 pm
Country: United Arab Emirates

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

Post by Kilrah » Fri Mar 27, 2015 5:41 pm

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?

User avatar
AustinSaintAubin
Posts: 7
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

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

Post by AustinSaintAubin » Fri Mar 27, 2015 6:30 pm

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.

User avatar
Kilrah
Posts: 8763
Joined: Sat Feb 18, 2012 6:56 pm
Country: United Arab Emirates

Re: Voice Sound Pack Generator - Mac OSX

Post by Kilrah » Sun Jul 05, 2015 12:59 pm

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

User avatar
AustinSaintAubin
Posts: 7
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin » Wed Jul 15, 2015 5:00 pm

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.


User avatar
rguptaca
Posts: 20
Joined: Sat Jul 25, 2015 7:07 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post by rguptaca » Fri Aug 07, 2015 8:53 am

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

User avatar
AustinSaintAubin
Posts: 7
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin » Tue Sep 15, 2015 3:58 am

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"

User avatar
rguptaca
Posts: 20
Joined: Sat Jul 25, 2015 7:07 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post by rguptaca » Tue Sep 15, 2015 3:47 pm

: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
Attachments
8PayAtte.wav
(317.31 KiB) Downloaded 4014 times
Rav

http://hikeforhappiness.ca

Sparky
Posts: 1
Joined: Sun Jan 24, 2016 3:59 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post by Sparky » Sun Jan 24, 2016 4:11 pm

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 (AustinSaintAubin@gmail.com)
   ∟ 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$

User avatar
AustinSaintAubin
Posts: 7
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin » Tue Jan 26, 2016 5:04 pm

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 (AustinSaintAubin@gmail.com)
   ∟ 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)

sendwaves
Posts: 1
Joined: Sat Aug 13, 2016 11:59 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post by sendwaves » Sun Aug 14, 2016 1:09 am

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...

User avatar
AustinSaintAubin
Posts: 7
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin » Thu Aug 18, 2016 1:39 pm

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.

TReu
Posts: 2
Joined: Mon Feb 06, 2017 3:16 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post by TReu » Mon Feb 06, 2017 3:18 pm

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.

User avatar
Kilrah
Posts: 8763
Joined: Sat Feb 18, 2012 6:56 pm
Country: United Arab Emirates

Re: Voice Sound Pack Generator - Mac OSX

Post by Kilrah » Mon Feb 06, 2017 4:59 pm

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.

User avatar
AustinSaintAubin
Posts: 7
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin » Tue Feb 07, 2017 1:21 am


TReu
Posts: 2
Joined: Mon Feb 06, 2017 3:16 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post by TReu » Mon Feb 20, 2017 8:32 am

Yes! Thanks so much!

Post Reply

Return to “Sound Pack Library”

Who is online

Users browsing this forum: No registered users and 1 guest