Voice Sound Pack Generator - Mac OSX

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

Voice Sound Pack Generator - Mac OSX

Post 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.
Last edited by AustinSaintAubin on Sat Jan 12, 2019 5:17 pm, edited 6 times in total.

User avatar
Kilrah
Posts: 11107
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

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

Post 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?
User avatar
AustinSaintAubin
Posts: 9
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 »

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: 11107
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Voice Sound Pack Generator - Mac OSX

Post 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
User avatar
AustinSaintAubin
Posts: 9
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post 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.
Last edited by AustinSaintAubin on Wed Nov 10, 2021 4:46 am, edited 2 times in total.

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

Re: Voice Sound Pack Generator - Mac OSX

Post 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
User avatar
AustinSaintAubin
Posts: 9
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post 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"
User avatar
rguptaca
Posts: 20
Joined: Sat Jul 25, 2015 7:07 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post 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
Attachments
8PayAtte.wav
(317.31 KiB) Downloaded 4695 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 »

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$ 
User avatar
AustinSaintAubin
Posts: 9
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post 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)
sendwaves
Posts: 1
Joined: Sat Aug 13, 2016 11:59 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post 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...
User avatar
AustinSaintAubin
Posts: 9
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post 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.
TReu
Posts: 2
Joined: Mon Feb 06, 2017 3:16 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post 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.
User avatar
Kilrah
Posts: 11107
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Voice Sound Pack Generator - Mac OSX

Post 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.
User avatar
AustinSaintAubin
Posts: 9
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin »

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

Re: Voice Sound Pack Generator - Mac OSX

Post by TReu »

Yes! Thanks so much!
User avatar
AustinSaintAubin
Posts: 9
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post by AustinSaintAubin »

Updated for OpenTX 2.2.3 w/ sdcard-taranis-x9-2.2V0018
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Voice Sound Pack Generator - Mac OSX

Post by jhsa »

You need an audio mixer :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
destroix
Posts: 1
Joined: Thu May 23, 2019 8:18 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post 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.
kjtemmes
Posts: 3
Joined: Sun Jun 02, 2019 5:44 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post by kjtemmes »

Hi.
AustinSaintAubin could you pls give permission to edit that google sheet to do some custom sounds to my x10s.
Thank you.
SoaringPhil
Posts: 1
Joined: Thu Aug 15, 2019 11:25 am
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post 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?
User avatar
AustinSaintAubin
Posts: 9
Joined: Fri Mar 27, 2015 3:02 pm
Country: United States
Location: Emdond, OK

Re: Voice Sound Pack Generator - Mac OSX

Post 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.
vikassmallik
Posts: 1
Joined: Thu Feb 03, 2022 1:16 pm
Country: -

Re: Voice Sound Pack Generator - Mac OSX

Post 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

Post Reply

Return to “Sound Pack Library”