Please or Register to create posts and topics.

custom sounds in portal 2

Page 1 of 2Next

when trying to get my sound files into the game i can listen to them in the preview but once ingame the won't start any idea why?

You need to type snd_rebuildaudiocache into the console, then the sounds should play.

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!

thanks for the quick response and thanks for the help.

But this is a bad solution for the final map. You would need to have a client command execute the rebuild for the player - with the bad downside that this can appearantly break the menu. At least that's what happened when I tried it this way: people couldn't use the menu anymore, thus the only way to close the game was CTRL+ALT+DEL.

Instead, use a MP3 with 44100 khz and 128 bit (as Damagepy described here). They might not work in Hammer and they won't work ingame unless you pack them into the .bsp - but they are small and don't require the cache rebuild.

I've found that maps with custom sound packed as wavs tend to automatically update my soundcache as soon as they are downloaded from the workshop,but that may not be universal in portal2 I guess...

Well, that solution sounds like it works well anyway.

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!
CamBen wrote:
I've found that maps with custom sound packed as wavs tend to automatically update my soundcache as soon as they are downloaded from the workshop,but that may not be universal in portal2 I guess...

Well, that solution sounds like it works well anyway.

The biggest problem is coop maps. Zivi and I messed around with this a lot whilst testing with Aperture Valentine. It often caused disconnections and other stuff. I even managed to disconnect from myself in a splitscreen game because I had to rebuild it twice. Just putting in an mp3 to the bsp (with the proper properties) is much easier and reliable for the players!

zivi7 wrote:
use a MP3 with 44100 khz and 128 bit

As far as I know MP3 files don't support cue points and therefore cannot be looped automaticly. Or am I wrong?

God bless the quick save's inventor...(Portal: Prelude)
greykarel wrote:
As far as I know MP3 files don't support cue points and therefore cannot be looped automaticly. Or am I wrong?

I didn't try it myself, but I've read everywhere that looping mp3s won't work for that reason indeed.

For a work-around you could try having a logic_timer retrigger the mp3 after it has been played.

I've spent much time making my custom background music work properly. I don't feel like using a timer for looping the sound and therefore prefer looped .wav files. To reduce file size some audio editors let you save your .wav file with different codec though some of them may not work in game. I used GoldWave to set cue points for looping and with different codecs managed to keep a reasonable file size (about 8-10MB instead of original 40-50MB). The only condition is 44100 khz.
Now if you pack your files into .bsp no one will have to update audio cash to hear sound in game. I can say it for sure for single player at least.

God bless the quick save's inventor...(Portal: Prelude)
greykarel wrote:
Now if you pack your files into .bsp no one will have to update audio cash to hear sound in game. I can say it for sure for single player at least.

Yes, this is what I was saying. I've packed custom sound effects into maps before, and they seem to work.

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!
Page 1 of 2Next