PDA

View Full Version : Customize your crew chief audio



BoothJoe
03-08-2017, 03:16 AM
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
04-05-2017, 11:44 AM
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
04-05-2017, 01:01 PM
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
04-05-2017, 04:43 PM
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
04-05-2017, 04:49 PM
Welcome to the CrewChief team BoothJoe :D

BoothJoe
04-05-2017, 05:26 PM
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
04-05-2017, 05:28 PM
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
04-06-2017, 10:35 AM
It's not the username. I have that one correct. Did you see the pics yet?

BoothJoe
04-06-2017, 01:29 PM
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
04-07-2017, 03:30 AM
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
04-07-2017, 11:54 AM
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
04-07-2017, 12:33 PM
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
04-07-2017, 12:42 PM
@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
04-07-2017, 01:00 PM
@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
04-07-2017, 01:06 PM
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
04-07-2017, 01:19 PM
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.