How to change sounds in a mod.

wiggersjoelt
Posts: 67
Joined: Fri Feb 04, 2022 1:25 am

How to change sounds in a mod.

Post by wiggersjoelt »

Hello,

I'm trying to figure out how to change the sound for a forage blower mod that I downloaded. I looked in the xml files and there's simply no reference anywhere to a sound file. How would I find the sound files for this mod?

Thanks,

Joel W
DirectCedar
Posts: 1031
Joined: Thu Apr 20, 2017 12:47 am

Re: How to change sounds in a mod.

Post by DirectCedar »

wiggersjoelt wrote: Sun Jan 07, 2024 11:27 pm Hello,

I'm trying to figure out how to change the sound for a forage blower mod that I downloaded. I looked in the xml files and there's simply no reference anywhere to a sound file. How would I find the sound files for this mod?

Thanks,

Joel W
Can you point me to a link for the actual mod? I have done this in the past with other mods and it wasn't that hard. However, looking through the specific mod files will probably be quicker than me guessing how the one you are looking at is actually set up.
wiggersjoelt
Posts: 67
Joined: Fri Feb 04, 2022 1:25 am

Re: How to change sounds in a mod.

Post by wiggersjoelt »

DirectCedar wrote: Mon Jan 08, 2024 12:14 am
wiggersjoelt wrote: Sun Jan 07, 2024 11:27 pm Hello,

I'm trying to figure out how to change the sound for a forage blower mod that I downloaded. I looked in the xml files and there's simply no reference anywhere to a sound file. How would I find the sound files for this mod?

Thanks,

Joel W
Can you point me to a link for the actual mod? I have done this in the past with other mods and it wasn't that hard. However, looking through the specific mod files will probably be quicker than me guessing how the one you are looking at is actually set up.

Thanks for your response. Its the John Deere 65 forage blower.

Joel W
DirectCedar
Posts: 1031
Joined: Thu Apr 20, 2017 12:47 am

Re: How to change sounds in a mod.

Post by DirectCedar »

wiggersjoelt wrote: Mon Jan 08, 2024 1:48 am
Joel W
I had a poke through this mod and I have an idea at least on how I would do this.

There are actually two spots in the .xml that reference sound files, which I think is what you'll need to change to call the different sound files that you want to use:

<dischargeStateSound template="augerBelt" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />

<!-- <sounds> -->
<!-- <actionSound template="defaultHydraulicSound" pitchScale="0.6" volumeScale="2" linkNode="0>1|0|0" actionNames="TOOL_MOVE_POS TOOL_MOVE_NEG" nodes="0>0"/> -->
<!-- </sounds> -->

(If you use Edit-Find-sound in notepad you'll find these specific lines in the xml)

I *think* that if a path is not specified (as shown above) when a sound file is called, then the mod defaults to a root directory in the base game installation where sound files are located. I believe the "augerBelt" and "defaultHydraulicSound" that are called are sound files from this root in the base game files. I don't have 22 installed on this computer to verify this at the moment.

I haven't actually changed a mod like this that called sound files from the base game library, but I have changed other mods that have their own folders with sounds specific to that mod. Again, I *think* that making the mod reference its own sound folder like this is as straightforward as adding a "sound" folder to the mod at the same level that the .xml is located, then editing the .xml to add a path to that sound folder instead of the generic path that is presently there.

These are a couple lines from a different mod where I did this, as an example of what the path looks like:

<motorStartSound file="sounds/Start.wav" pitchOffset="0.77" volume="1.00" indoorVolumeFactor="0.65" indoorLowpassGain="0.95"/>
<motorSound file="sounds/Idle.ogg" pitchOffset="0.77" volume="1.00" indoorVolumeFactor="0.65" indoorLowpassGain="0.95" pitchMax="1.20" volumeMin="0.50" volumeMinSpeed="36" pitchScale="0.02" />
<motorStopSound file="sounds/Stop.ogg" pitchOffset="0.90" volume="1.00" indoorVolumeFactor="0.65" indoorLowpassGain="0.65" />

Alternately, if you wanted to use different base game sounds and not something completely new, I think all you would need to do is find the file name of the sound you wanted to use that is already in the base game sound directory, and just change the name of the sound file called in the xml to the sound you want to use. I don't think you'd need to add or change a path in that case.

I hope I'm on the right track here and that this is some help to you.
wiggersjoelt
Posts: 67
Joined: Fri Feb 04, 2022 1:25 am

Re: How to change sounds in a mod.

Post by wiggersjoelt »

Thank you so much for your help, I'll give that a try. I really appreciate you taking the time to help me out with this and explaining it so well!

Thanks again!!

Joel W
wiggersjoelt
Posts: 67
Joined: Fri Feb 04, 2022 1:25 am

Re: How to change sounds in a mod.

Post by wiggersjoelt »

DirectCedar wrote: Mon Jan 08, 2024 9:50 pm
wiggersjoelt wrote: Mon Jan 08, 2024 1:48 am
Joel W
I had a poke through this mod and I have an idea at least on how I would do this.

There are actually two spots in the .xml that reference sound files, which I think is what you'll need to change to call the different sound files that you want to use:

<dischargeStateSound template="augerBelt" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />

<!-- <sounds> -->
<!-- <actionSound template="defaultHydraulicSound" pitchScale="0.6" volumeScale="2" linkNode="0>1|0|0" actionNames="TOOL_MOVE_POS TOOL_MOVE_NEG" nodes="0>0"/> -->
<!-- </sounds> -->

(If you use Edit-Find-sound in notepad you'll find these specific lines in the xml)

I *think* that if a path is not specified (as shown above) when a sound file is called, then the mod defaults to a root directory in the base game installation where sound files are located. I believe the "augerBelt" and "defaultHydraulicSound" that are called are sound files from this root in the base game files. I don't have 22 installed on this computer to verify this at the moment.

I haven't actually changed a mod like this that called sound files from the base game library, but I have changed other mods that have their own folders with sounds specific to that mod. Again, I *think* that making the mod reference its own sound folder like this is as straightforward as adding a "sound" folder to the mod at the same level that the .xml is located, then editing the .xml to add a path to that sound folder instead of the generic path that is presently there.

These are a couple lines from a different mod where I did this, as an example of what the path looks like:

<motorStartSound file="sounds/Start.wav" pitchOffset="0.77" volume="1.00" indoorVolumeFactor="0.65" indoorLowpassGain="0.95"/>
<motorSound file="sounds/Idle.ogg" pitchOffset="0.77" volume="1.00" indoorVolumeFactor="0.65" indoorLowpassGain="0.95" pitchMax="1.20" volumeMin="0.50" volumeMinSpeed="36" pitchScale="0.02" />
<motorStopSound file="sounds/Stop.ogg" pitchOffset="0.90" volume="1.00" indoorVolumeFactor="0.65" indoorLowpassGain="0.65" />

Alternately, if you wanted to use different base game sounds and not something completely new, I think all you would need to do is find the file name of the sound you wanted to use that is already in the base game sound directory, and just change the name of the sound file called in the xml to the sound you want to use. I don't think you'd need to add or change a path in that case.

I hope I'm on the right track here and that this is some help to you.
Okay, I've been fighting with trying to change the sound on this blower and I'm just not having any luck. I will tell you the steps I performed so you get an idea of how I tried to change the sound on this blower. I downloaded a video from Youtube of a forage blower running and then I extracted the audio from it. Then I converted it to an ogg file and saved it as silageblower.ogg. Then I copied the file "silageblower.ogg" into the root folder of the "FS22_JohnDeere65" mod folder. Now I'm struggling to figure out how to reference this sound file from within the "Deere65.xml" file. As you pointed out "DirectCedar," the original "Deere65.xml" references a template called "augerBelt" for the sound. What does it mean by "template?" How do I direct the xml file to the silageblower.ogg file? Do I need to make some sort of template first or edit a template somewhere? Here is the line of code that I'm talking about "<dischargeStateSound template="augerBelt" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />" Do I need to change the word template to filename instead?

Any help would be so much appreciated?

Thanks,

Joel W
DirectCedar
Posts: 1031
Joined: Thu Apr 20, 2017 12:47 am

Re: How to change sounds in a mod.

Post by DirectCedar »

wiggersjoelt wrote: Thu Jan 11, 2024 1:13 am Okay, I've been fighting with trying to change the sound on this blower and I'm just not having any luck. I will tell you the steps I performed so you get an idea of how I tried to change the sound on this blower. I downloaded a video from Youtube of a forage blower running and then I extracted the audio from it. Then I converted it to an ogg file and saved it as silageblower.ogg. Then I copied the file "silageblower.ogg" into the root folder of the "FS22_JohnDeere65" mod folder. Now I'm struggling to figure out how to reference this sound file from within the "Deere65.xml" file. As you pointed out "DirectCedar," the original "Deere65.xml" references a template called "augerBelt" for the sound. What does it mean by "template?" How do I direct the xml file to the silageblower.ogg file? Do I need to make some sort of template first or edit a template somewhere? Here is the line of code that I'm talking about "<dischargeStateSound template="augerBelt" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />" Do I need to change the word template to filename instead?

Any help would be so much appreciated?

Thanks,

Joel W
First question - do you know that in order to edit a mod, you must unzip the mod, make the changes to the folders or files, and then rezip the mod back to its original filename, and replace the original mod with the edited mod? You cannot make changes to a mod without unzipping it, and you cannot use it in its edited form without re-zipping it. Just making sure about this.

I *think* what you need to do is (Unfortunately I have not done this on 22, but I have done it on 17 and 19, and the code looks very similar to me):

-make a backup copy of the unedited mod somewhere for safekeeping
-unzip the mod to a temp folder on your desktop, or wherever
-add a folder called sounds to the top level of the unzipped mod files. Create it at the same level where you see the .xml file that will be edited.
-put your new sound file in that newly-created folder - assume the new sound file is called silageblower.ogg as you have indicated.
-open the .xml in notepad
-find the line of code you describe above: "<dischargeStateSound template="augerBelt" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />"
-edit this line to call the new sound file from your new folder. Use the format of the example code I pasted above from a different mod where I did what you are trying to do. This will specify the new path to this sound's location. I believe your edited code should read:
"<dischargeStateSound file="sounds/silageblower.ogg" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />"
-save the edited xml in notepad and close it
-re-zip all the mod files in the same order and structure that they were in the original mod, using the same filename as the original mod
-put the edited mod in your mods folder. File Explorer should ask you if you want to replace the existing file, because it will have the identical name.
-start the game and test it
-you might need to edit the pitch, volume, fadeIn, or fadeOut values to make it sound how you like, since you're working with a brand new sound that hasn't been configured yet to fit nicely in the game

Best of luck.
wiggersjoelt
Posts: 67
Joined: Fri Feb 04, 2022 1:25 am

Re: How to change sounds in a mod.

Post by wiggersjoelt »

DirectCedar wrote: Thu Jan 11, 2024 6:25 pm
wiggersjoelt wrote: Thu Jan 11, 2024 1:13 am Okay, I've been fighting with trying to change the sound on this blower and I'm just not having any luck. I will tell you the steps I performed so you get an idea of how I tried to change the sound on this blower. I downloaded a video from Youtube of a forage blower running and then I extracted the audio from it. Then I converted it to an ogg file and saved it as silageblower.ogg. Then I copied the file "silageblower.ogg" into the root folder of the "FS22_JohnDeere65" mod folder. Now I'm struggling to figure out how to reference this sound file from within the "Deere65.xml" file. As you pointed out "DirectCedar," the original "Deere65.xml" references a template called "augerBelt" for the sound. What does it mean by "template?" How do I direct the xml file to the silageblower.ogg file? Do I need to make some sort of template first or edit a template somewhere? Here is the line of code that I'm talking about "<dischargeStateSound template="augerBelt" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />" Do I need to change the word template to filename instead?

Any help would be so much appreciated?

Thanks,

Joel W
First question - do you know that in order to edit a mod, you must unzip the mod, make the changes to the folders or files, and then rezip the mod back to its original filename, and replace the original mod with the edited mod? You cannot make changes to a mod without unzipping it, and you cannot use it in its edited form without re-zipping it. Just making sure about this.

I *think* what you need to do is (Unfortunately I have not done this on 22, but I have done it on 17 and 19, and the code looks very similar to me):

-make a backup copy of the unedited mod somewhere for safekeeping
-unzip the mod to a temp folder on your desktop, or wherever
-add a folder called sounds to the top level of the unzipped mod files. Create it at the same level where you see the .xml file that will be edited.
-put your new sound file in that newly-created folder - assume the new sound file is called silageblower.ogg as you have indicated.
-open the .xml in notepad
-find the line of code you describe above: "<dischargeStateSound template="augerBelt" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />"
-edit this line to call the new sound file from your new folder. Use the format of the example code I pasted above from a different mod where I did what you are trying to do. This will specify the new path to this sound's location. I believe your edited code should read:
"<dischargeStateSound file="sounds/silageblower.ogg" pitchScale="0.65" volumeScale="1.1" fadeIn="0.5" fadeOut="2.7" />"
-save the edited xml in notepad and close it
-re-zip all the mod files in the same order and structure that they were in the original mod, using the same filename as the original mod
-put the edited mod in your mods folder. File Explorer should ask you if you want to replace the existing file, because it will have the identical name.
-start the game and test it
-you might need to edit the pitch, volume, fadeIn, or fadeOut values to make it sound how you like, since you're working with a brand new sound that hasn't been configured yet to fit nicely in the game

Best of luck.
Thanks for all your help. I was able to get it figured out and change the sound.

Thank you again!

Joel W
DirectCedar
Posts: 1031
Joined: Thu Apr 20, 2017 12:47 am

Re: How to change sounds in a mod.

Post by DirectCedar »

wiggersjoelt wrote: Thu Jan 11, 2024 11:29 pm Thanks for all your help. I was able to get it figured out and change the sound.

Thank you again!

Joel W
You're welcome.
Post Reply