PDA

View Full Version : Customize your crew chief audio



BoothJoe
08-03-2017, 03:16
Attached is a zip file containing several python scripts that allow you to change the voice that CrewChief uses. It will use the default Microsoft voice on your computer, which is then filtered and smaugged to have a "radio-y" effect. You can do these things:
Have custom messages for every event in the CrewChief voice library.
Have your own personalization.
Have your own set of drivers.

The scripts use two commandline programs--balcon to create the wav files and sox to do the filtering and snooshing. This uses the balcon text to speech engine, so the audio will not sound like a real voice...the intonation and inflection are just not there. But once it game, it's really not that bad.

I created this because I wanted the accent of my homeland and I wanted my own messages. I wanted my crewchief to tell me: "If you run off the track again, you'll be a greeter at WalMart next weekend" and things like that. And I wanted my own set of drivers (I use great authors).

Oh, it was written for Race Factor 2. I should have said that earlier. I'm not sure of the setup for other sims, but all the scripts are editable with a standard text editor so you could change them to your heart's content.

[Edit] Fixed syntax error in attached file.

bereklauw
05-04-2017, 11:44
Hello i want to add my own name fr the crewchief and i want to add my leagues driver names. Everytime i want to try it with this voice build i get errors with python. Can you please help me?

111213

BoothJoe
05-04-2017, 13:01
I'm sorry, I can't read the images. They are too small. When I enlarge them so I can see them, they are too fuzzy to read.

bereklauw
05-04-2017, 16:43
14

I have put them in a zip file. Is it possible for you to open it? Otherwise please send ur email and i will email them if you like.

mr_belowski
05-04-2017, 16:49
Welcome to the CrewChief team BoothJoe :D

BoothJoe
05-04-2017, 17:26
I will have to check this at home tonight where I run Windows. But from the error messages, the USERNAME variable may be wrong. The USERNAME you need to enter at the top of the .py file is the username on your computer and not your crewchief/Steam/RF2/etc. username. It would be whatever is in c:\users\ . Same username you use to log into your computer.

BoothJoe
05-04-2017, 17:28
Welcome to the CrewChief team BoothJoe :D

Thanks. I haven't raced in weeks and I saw you put out a new version or two but I haven't kept up with the Python stuff. I bought a CNC machine and that is sucking my life away right now (trying to learn to use it and Fusion360 and gcode and machining terminology).

bereklauw
06-04-2017, 10:35
It's not the username. I have that one correct. Did you see the pics yet?

BoothJoe
06-04-2017, 13:29
It's not the username. I have that one correct. Did you see the pics yet?


It's not the username. I have that one correct. Did you see the pics yet?
Yes, I saw them. The third png file has an incorrect line in it because the error reports a problem with \\user and that should be \\users. The other two pngs show it as \\users, which is correct because it's referring to c:\users\username....

This could be an OS thing because it works on W10 at home but not on W7 at work. Of course, I don't have RF2 installed at work so I get other errors. Try this: replace the

with open ('\\users" + USERNAME + "\\Desktop\\My_Crewchief\\CC_drivers.txt','r') as data:
for line in data:
process (line)
with

path = "\\users" + USERNAME + "\\Desktop\\My_Crewchief\\CC_voice.txt"
with open (path,'r') as data:
for line in data:
process (line)

Please note that you need to indent the lines for python. The indents don't show up here but they should be the same as in the code.

BoothJoe
07-04-2017, 03:30
There's an error in the code you need to change. In the new code, change the word CC_voice.txt to CC_drivers.txt.

bereklauw
07-04-2017, 11:54
I guess i'll have to leave it. Nothing is working. I appreciate your effort but this will never work out. The other spotter for rfactor 2 is really easy to adjust and make your own names in it but this is to hard.

BoothJoe
07-04-2017, 12:33
I guess i'll have to leave it. Nothing is working. I appreciate your effort but this will never work out. The other spotter for rfactor 2 is really easy to adjust and make your own names in it but this is to hard.

I've used both and I agree that the one by Gerald is much easier to customize. This one is fine if you use it straight out of the box.

I ran all of the Python stuff last night and it ran fine after I made the corrections I posted. But there are a lot of variables including where everything is stored, filenames, python version, etc.

Sparten
07-04-2017, 12:42
@BoothJoe Therre is a syntax error in CC_drivers.py ('\\users\"...
Its starting a quote with ' and ends it with a " and then after USERNAME it starts the qoute with a " and ends it with a '
Maby thats got something to do with the errors.

BoothJoe
07-04-2017, 13:00
@BoothJoe Therre is a syntax error in CC_drivers.py ('\\users"...
Its starting a quote with ' and ends it with a " and then after USERNAME it starts the qoute with a " and ends it with a '
Maby thats got something to do with the errors.

Well, that's interesting. The original file I have on disk is not the same as the file that gets unzipped. I don't think anyone is really interested in the Python stuff anyway.

Sparten
07-04-2017, 13:06
I downloaded the file directly from rF2 forums and uploaded it here without edeting anything, I'll can make that small correction and reupload the .zip if you dont mind?

BoothJoe
07-04-2017, 13:19
I downloaded the file directly from rF2 forums and uploaded it here without edeting anything, I'll can make that small correction and reupload the .zip if you dont mind?

Certainly. I don't have my builds here at work. I'm not sure how much of this still works any way since the latest changes. I've been busy with other stuff and haven't raced in a couple of weeks. And then the new Stellaris stuff came out yesterday.

AppieWe
15-05-2020, 14:25
Hi
I receive this error.

Traceback (most recent call last):
File "C:\Users\AppieW\Desktop\My_Crewchief\CC_voice.py", line 25, in <module>
process (line)
File "C:\Users\AppieW\Desktop\My_Crewchief\CC_voice.py", line 19, in process
call(['sox', 'temp.wav', 'temp1.wav', 'silence', '1', '0.1', '.02%', 'reverse', 'silence', '1', '0.1', '.01%', 'reverse', 'silence', '1', '0.1', '.01%', 'highpass', '800', 'tempo', '1.30'])
File "C:\Users\AppieW\AppData\Local\Programs\Python\Pyth on38-32\lib\subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\AppieW\AppData\Local\Programs\Python\Pyth on38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\AppieW\AppData\Local\Programs\Python\Pyth on38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
>>>
what can I do to solve it.
thx a lot
Albert

mr_belowski
15-05-2020, 15:28
no idea what CC_voice.py is