Please or Register to create posts and topics.

Importing Custom Sounds

Page 1 of 3Next

Hello guys! I just wanted to know how to import custom sounds into a map, or at least into to portal 2 files. I've seen parts of some tutorials, but they all have very complicated methods involving the use of notepad. If there is no other way though, could someone provide a link to a good tutorial? OH and one more thing- does the sound have to be a specific file? I would like to use wav files, but if not I could hopefully convet it somehow...
Thanks in advance!

Here's my method for importing custom sounds.

1. First, get the sound that you want. If the sound is already a .wav file and has a rate of 44100 HZ, skip to step 4.
2. Load the sound in audacity (free program, download here http://audacity.sourceforge.net/download/ ) and change rate to 44100 HZ.
3. Export as a .wav file.
4. Open up your portal 2 directory, go to sounds, and then make a folder called "custom" without the quotes, (or whatever name you want.) Stick the sound file in there.
5. Open hammer editor, open your map, and make an ambient_generic with a trigger to make it play the sound.
6. Go to the ambient generic, sound name property, and then it's either under raw or game sounds, (I can't remember.) Set the filter to "custom" without the quotes, (or whatever you called the folder,) and hit refresh sounds.
7. Select your sound, listen to it to make sure it works and is the right one, and apply the changes. Compile your map.
8. Launch Portal 2.
9. Launch your map.
10. Type in console "snd_rebuildsoundcache" without the quotes. Every time you add a new sound to Portal 2, you must do this. (So if you're planning on adding a bunch of sounds, put them all into the sounds folder, then run this command, instead of doing it for every single sound. It takes a few minutes.)
11. Wait for it to complete.
12. Your map will restart, and you custom sound should work!

I'm not a pro mapper, so if anyone finds something wrong with this tutorial, please say so. It should work though. Tell me how it turns out!

Do what Killerblonde wrote, but stop with point 8. Don't start Portal.
If you would use the snd_rebuildsoundcache, you would have to do it every time again for a new sound and it wouldn't help if you want to share the map, because others won't have a rebuilded cache.
Use VPKs instead.
Read this: http://developer.valvesoftware.com/wiki ... rtal_2_Map
Now just pack your custom sounds into the VPK, keep the folder structure, and put your VPK to portal 2portal2addons
If any new sound file is in a VPK, the game won't need any cache rebuilding and you can give anyone this VPK (in the final version with your map included) and everyone will hear the sounds by just starting the map ;)

Thanks you two! This really helped me, as I've been recording and modifying my voice to put in some maps. Expect new ones soon!

VPK's are the way to share your sounds, for sure. I guess they could work with testing your maps too, I never thought of that. I just stick all my custom stuff in there, and do the console command; VPK's I save for last.

Anyhow, thanks Skotty for offering a better way to do it. I'll look forward to hearing your beautiful voice TripleG10!

wouldnt pakrat work?

Just when I think I understand the system, it changes on me.

Wait, wait, wait!

I thought anyone here agreed that .vpks were broken in Portal 2 since the appearance of DLC1. So it is impossible to get it to work, isn't it?

I have no experience with implementing custom sounds, but I was gonna do this, and I thought the only possibility would be to use pakrat to pak them into your map and then command "snd_updateaudiocache" instead of "snd_rebuildsoundcache".

The Aperture Alpha
A map pack coming soon. - click for more information
Image

the portal 2/portal2/addons won't help right now because of the bug
What you can do is create a portal 2/portal2_dlc3, name your vpk pak01_dir.vpk and put it in there.

Note it needs to be this folder and this file name.
Basically you're telling the game that there's new dlc :P

Brainstone wrote:
Wait, wait, wait!

I thought anyone here agreed that .vpks were broken in Portal 2 since the appearance of DLC1. So it is impossible to get it to work, isn't it?

I have no experience with implementing custom sounds, but I was gonna do this, and I thought the only possibility would be to use pakrat to pak them into your map and then command "snd_updateaudiocache" instead of "snd_rebuildsoundcache".

Note that this is a post from august 2011, before the dlc came out.

@Fracture:
The problem is with sounds in a bsp you need to rebuild the audio cache, if you would have read the previous posts you would've known.
Ps: Why are you bumping a thread from august 2011?

Lpfreaky90 wrote:
The problem is with sounds in a bsp you need to rebuild the audio cache

Well, I must say something has changed.
In my last map Hard Light I used some Portal 1 glados lines. May be there is a better way, but I used it as custom
sounds (extracted .waw files from portal 1 .gcf, placed them in portal2/sound/hard_light). Hammer finds and
playes them ok, but in game I couldn't hear them until I packed them into .bsp with Pakrat. So I didn't rebuiled
sound cash (I just didn't know I should) and I don't think anyone who played the map did it, but the lines played for them allright.

God bless the quick save's inventor...(Portal: Prelude)
Page 1 of 3Next