custom sounds in portal 2
Quote from blackdynamite on March 16, 2013, 5:14 pmwhen 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?
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?
Quote from CamBen on March 16, 2013, 5:48 pmYou need to type snd_rebuildaudiocache into the console, then the sounds should play.
You need to type snd_rebuildaudiocache into the console, then the sounds should play.
Aperture Science: We do our science asbestos we can!
Quote from blackdynamite on March 16, 2013, 7:48 pmthanks for the quick response and thanks for the help.
thanks for the quick response and thanks for the help.
Quote from zivi7 on March 16, 2013, 10:20 pmBut 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.
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.
Quote from CamBen on March 17, 2013, 3:23 amI'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.
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.
Aperture Science: We do our science asbestos we can!
Quote from Lpfreaky90 on March 17, 2013, 4:36 amCamBen 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!
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!
Quote from greykarel on March 17, 2013, 11:30 amzivi7 wrote:use a MP3 with 44100 khz and 128 bitAs far as I know MP3 files don't support cue points and therefore cannot be looped automaticly. Or am I wrong?
As far as I know MP3 files don't support cue points and therefore cannot be looped automaticly. Or am I wrong?
Quote from zivi7 on March 17, 2013, 4:53 pmgreykarel 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 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.
Quote from greykarel on March 18, 2013, 6:01 amI'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.
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.
Quote from CamBen on March 19, 2013, 12:48 amgreykarel 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.
Yes, this is what I was saying. I've packed custom sound effects into maps before, and they seem to work.
Aperture Science: We do our science asbestos we can!