Jump to content

Help with adding sound effects!


Razzinnator

Recommended Posts

First of all, I'm quite a beginner modder, so take me slowly if there's anything really complicated please :).

Basically, I'm taking it slowly, and making a simple but funny mod for me and my friends. I want to try and make as many different things as possible, to get more experience with the CK, and I'm really stuck right now.

I want to add a custom sound. I have it downloaded, converted to .wav, but I have no idea how to actually add it in game. I think I might be able to get the scripting part done, but I don't know how to actually import it into the editor.

Any ideas?

 

Thanks in advance.

Link to comment
Share on other sites

First off, what sort of sound are you trying to add? What actor/object will you be attaching it to, and what action will be calling the sound?

There are many ways to skin a cat, so more detail will help narrow down the required procedure.

Link to comment
Share on other sites

Basically I have a large room with a chest and some more clutter. When the chest gets activated, a certain sound is played, the dungeon's boss appears behind you, resurrects several monsters and runs away throwing spells at you. I've got most of the scripting already done and working, but I have no idea how to take my custom sound from outside the CK, create a Sound object, and make it used by my script.

Sorry for the lack of details in my initial post, I was quite tired after several hours of work on this and couldn't be very clear.

Also, thank you for the quick response, as I've seen many posts with similar issues with no replies after several weeks.

Edited by Razzinnator
Link to comment
Share on other sites

Basically I have a large room with a chest and some more clutter. When the chest gets activated, a certain sound is played, the dungeon's boss appears behind you, resurrects several monsters and runs away throwing spells at you. I've got most of the scripting already done and working, but I have no idea how to take my custom sound from outside the CK, create a Sound object, and make it used by my script.

Sorry for the lack of details in my initial post, I was quite tired after several hours of work on this and couldn't be very clear.

Also, thank you for the quick response, as I've seen many posts with similar issues with no replies after several weeks.

 

OK. Try this:

 

1) Make sure the sound format in your .wav file is PCM 44100kHz 16 bit mono. The sound might not work if it is different, depending on how it is used in the game (I found that some sounds won't work if they are stereo, so it is safest to try mono first).

 

2) In the CK, go to the Object Window. In the left pane, scroll down until you find AUDIO. In the audio sub-tree click on Sound Descriptor. In the right pane, right-click and choose NEW. Fill out this form as follows:

- Type in a name for your sound, such as "DRScMyChestOpen".

- In the Sound tab, right-click and choose New. Here you browse to your .wav file and select it. (tip: you can attach multiple sound files here, one will be selected randomly for playback each time).

- Now in "Category:" pick "AudioCategorySFX" from the list. (this part affects how the sound volume is controlled by the game Options volume sliders, when entering menus etc)

- In "Output Model:" pick "SOMMono1400_verb". (this part controls how the sound will fall off over a distance from the source. In this case a distance of 1400 is used, with strong reverberation. You can experiment here.)

- Leave Static Attenuation at zero for now. (this option can be used to decrease the payback volume by x decibels if that particular sound is too loud.). Also leave dB Variance at zero (it's a volume randomizer).

- Set "Looping:" to NONE. (tip: note that sound files that are loops must have "LP" at the end of their file name or they won't work)

- Leave %Frequency Shift and %Frequency Variance at zero. (they are used randomize the speed and pitch of the sound a bit)

- Leave the Priority at default. The Rumble Send option is for sending vibrations to a gamepad controller. No need to use it here.

 

NOTE: Once you start doing stuff in the Audio section of the CK, it often sets off a time-bomb and about 20 minutes later the CK will crash (fault module "XAudio2_6.dll_unloaded") ! Save often.

 

3) Presuming your chest is a Container object, it should have an associated form under "WorldObjects" - "Container". Find your form and double-click it to edit it:

- in the "Sounds" field on the bottom-left of the form are two wide buttons: Open and Close. Click the first button and attach your custom sound (DRScMyChestOpen). If you want to reuse this sound when the chest is closed then do the same on the Close button. That's it!

 

Alternative method using a script:

 

Instead of doing it by step 3, if you want to call your sound from a script, then you need to create a Sound Marker that points to DRScMyChestOpen. You can do this in the Sound Marker sub-tree in the Audio tree from the Object Window. Create a new marker and give it a unique name such as "MyChestOpen" then pick your Sound Descriptor from the drop-down list. Now your chest script will need to have something like this:

 

Scriptname MyCustomChestSound extends ObjectReference  ; you can give the script a different name if you like
Sound property mySFX1 auto      ; here we define a property "MySFX1" which we will point at the Sound Marker we created earlier. You can use a different property name if you like.

Event OnActivate(ObjectReference akActionRef)                                   ; when the chest is activated we will do our cool stuff
      		int instanceID = mySFX1.play(self)          				; play mySFX1 sound from my self
 		Sound.SetInstanceVolume(instanceID, 1.0)   			; play at full volume
EndEvent

 

OK, so if you attach a script like this to your chest, then select the script and click the Properties button a form should appear with "mySFX1" as a property. Click it and in the "Pick Object:" drop-down list select your Sound Marker (MyChestOpen). That's it!

 

Ok, have fun experimenting and let me know if you get it to work. Endorsements are welcome :)

Edited by steve40
Link to comment
Share on other sites

First of all, thanks a lot for taking the time to write such a detailed response :). I read it all and I can say I understood all of it, although I'm still running into a problem. When I create my Sound Descriptor, open its properties, right-click in the Sound table and try to add a new sound, it gives me an error message that says "Invalid directory.". I tried messing around with the sound, moving it to different folders but nothing seemed to work.

Any ideas on this issue?

Link to comment
Share on other sites

First of all, thanks a lot for taking the time to write such a detailed response :). I read it all and I can say I understood all of it, although I'm still running into a problem. When I create my Sound Descriptor, open its properties, right-click in the Sound table and try to add a new sound, it gives me an error message that says "Invalid directory.". I tried messing around with the sound, moving it to different folders but nothing seemed to work.

Any ideas on this issue?

 

Basically, if you try to load a sound file that is outside of the Skyrim data structure the CK will spit out an error.

You should put your sound effect files in a subfolder of "Data\sound" under your Sykrim folder. I'd recommend using "Data\sound\obj\my_chest" for example. For creature sound effects, I use "Data\sound\fx\npc\mymonster\". Similarly, music files must go into the "Data\music\" folder structure. For example, "Data\music\mycustommusic".

 

Edit: Oops, the example folder I gave above is slightly wrong, it should be "Data\sound\fx\obj\my_chest" otherwise the CK won't accept the path because the sound effect wav files must be placed in a folder under "Data\sound\fx\". :facepalm:

Edited by steve40
Link to comment
Share on other sites

Now that I think of it, what you just said makes perfect sense, and still I am being given the same error message over and over again.

I also did a bit more searching yesterday, and somewhere I stumbled upon this: there is a bug in the CK that automatically adds an extra \ at the beginning of any path to a sound file that you're trying to import. I can't find that post anymore, but could this be the cause?

Edited by Razzinnator
Link to comment
Share on other sites

No, that bug should not be an issue unless you are using an older version of CK. it' very late, I have to get up early tomorrow. I'll look into it tomorrow afternoon, maybe I missed something in my instructions. Cheers
Link to comment
Share on other sites

I'll keep looking and maybe I'll be able to find something. If not, I'll just shift my attention elsewhere, and go for a full reinstall of skyrim and the CK in case something went wrong with my updating.

Thanks for all the help, I'm going to need everything you said here once I fix this minor quirk!

Link to comment
Share on other sites

Ok, here's the answer: the path for the sound effects must be in "\Data\sound\fx\" under your Skyrim's main folder. The example I gave you (Data\sound\obj\mychest) was wrong, it should be "Data\sound\fx\obj\my_chest\".

 

So just to clarify, if you have a 32bit computer the wav files must be put into "C:\Program Files\Steam\steamapps\common\skyrim\data\sound\fx" (or a subdirectory of this).

If you have a 64bit computer, the wav files need to be put into "C:\Program Files (x86)\Steam\steamapps\common\skyrim\data\sound\fx" (or a subfolder of this).

 

If it still isn't working after doing the above, then try right-clicking on your Skyrim's Data folder in Windows, go into Properties, choose the Security tab, click the Edit button to change permissions, select Users and check the "Full control" box to give full read+write acess to the Data folder. Let this propagate to the sub-folders as well when you close the dialog box. Also, run the CK as Administrator. If you still can't add your sound file after all this, then I don't know what the problem could be! :tongue:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...