Custom Sounds in map - how to upload them in BSP? [SOLVED]
I'm in the situation where I have finished my custom story in Hammer.
I want to create a "Beta" for my friend, containing only 1 map.
The problem is that we can't make the custom sound files to work.
I read about Pakrat and tried using it. This is what I did.
After compiling my map I opened Pakrat.
In Pakrat I opened the mymap.bsp
Then I clicked "Add".
Then I found the custom sound files and added them.
I also added the mymap.txt which contains all the necessary lines for the sound files to work.
Then I click "Save BSP".
Then I send the BSP to my friend.
I install the map as everyone does but when he plays it everything is there, but the sound files.
How do I implement them in my BSP file?
It has to be said that I can play all the files on my computer, because they're in the right directories and so and so...
It's only when I pack it into a BSP it doesn't work.
You can set this to be done automatically by going to File > Preferences. You should have the "Path fixup on add file" on one of these options: "Never", "Ask", "Always". I set it to "Ask", because I want to make sure that it does its work.
Check out this.
Also, are you using soundscapes? Have you named your script file correctly relative to your map? something like soundscapes_beecake_new_map.TXT
josepezdj wrote:
@Beecake: you didn't mention anything related to fixing up the path to the files when you listed the things you did. Maybe that is your problem. What pakrat does is just fix up the paths to your custom files so that when your map searches for them in game, it searches inside the .BSP instead of the original locations your custom files are in.You can set this to be done automatically by going to File > Preferences. You should have the "Path fixup on add file" on one of these options: "Never", "Ask", "Always". I set it to "Ask", because I want to make sure that it does its work.
Check out this.
Also, are you using soundscapes? Have you named your script file correctly relative to your map? something like soundscapes_beecake_new_map.TXT
I have no script files, because I am using no soundscapes.
Have no experience in them yet...
Everything I'm using is ordinary ambient_generics
I'll take a look at your idea and report back!
beecake wrote:
I have no script files, because I am using no soundscapes.
Have no experience in them yet...
Hmmm.... then what is that "mymap.txt" file that you mentioned you needed for your sound files to work?
josepezdj wrote:
beecake wrote:I have no script files, because I am using no soundscapes.
Have no experience in them yet...Hmmm.... then what is that "mymap.txt" file that you mentioned you needed for your sound files to work?
Well the sounds I have are custom (Placed in the /temp folder), and I have to write the path of the sounds to make them work. That's what I read about, at least, and it's working, so things should be good.
josepezdj wrote:
I think it's way simpler. Just put your sounds under your /sound folder or /sound/music (and create your own custom folder there too if you want) and you're done. They should be working in game without the need of any other "path file".
Oh well, it's just a text file. I can always delete it.
I'll be checking if it works when I delete it today. Thanks.
This is how it looks in Pakrat right now

Does it look ok?
I checked the preferences and it seems like it is already on "Ask" to begin with.
One tip: in order to have a clearer view into pakrat you can choose to see the packed elements list "As a Tree" by going to View menu 
josepezdj wrote:
Well, that looks good.... as long as you DID fix up the paths, it should be working.One tip: in order to have a clearer view into pakrat you can choose to see the packed elements list "As a Tree" by going to View menu
I actually didn't do anything with the paths.
I'm not sure what I'm suppposed to do. I just chekked whether the "Path fixup on add file" was on "Ask", and it was.
What exactly am I supposed to do?
Lpfreaky90 wrote:
maybe try the snd_rebuildaudiocache command in game?
On my friends computer, or on mine?
What will it do? Create a .cache file that I have to put in the .BSP?
EDIT: I tried doing what you said, then I recompiled my map, and added the sound files to the .BSP. still nothing.
EDIT2: OK OK OK!
My friend just noticed that in his console it says that the sound "Can't create mixer".
I've been experiencing this before, but somehow solved it. Does this help solving the problem?
Arachnaphob wrote:
If you're using .Wav, then make sure it's 16 bit. Put it into audacity and export it again. It should be the default option.
If you look in the picture above, they're all mp3 
protoborg wrote:
Are you using a custom file path for your sound files? Pakrat tends to use the default file path for resources since it makes it easier for other people to use your map that way.
My soundfiles are in Steam\Steamapps\Common\Portal2\Portal2\sound\Temp
Is that custom?
Where is it supposed to point to?
This is how it all looks. Do you need more info?
beecake wrote:
This is how it all looks. Do you need more info?
http://oi60.tinypic.com/30a4z6t.jpg
If you have your settings like that, then, after you browse your music files and click on the 'Add' button, it should have asked you to fix up the paths for your files; and you must have said "Yes to all". Don't you remember that step? 
After you have correctly added your sound files into your BSP, in the case that you (or your friend) can't hear them in game, you should always check what your console says:
-
If you have the error message "Can't create mixer" = Check out that you DID create your sound file at 44100Hz (no matter if it's .MP3 or .WAV). Then check out your ambient_generic and recreate it to see if that fixes it.
-
If you have the "missing sound from disk/repository" = That can be fixed quickly by rebuilding or updating your sound cache entering one of these commands into your console:
- snd_updateaudiocache
- snd_rebuildaudiocache
However, once you have your audio files into the BSP the game looks into it and you should not have that latter error message...
Hmmm..... can you say what audio programs are you using? sometimes there are some of them that automatically change the sample rating when you are about to save them, because there are some settings to do so in your program's 'Preferences'
I've never been fiddling with what kind of sound file it is, so it IS 44100Hz. Otherwise, I wouldn't be able to hear the files myself would I?
He was getting the error: "Can't create mixer". I got this too, once. Not that my sound files were wrong at that point. They were exactly the same.
EDIT: Now when I think about it, it was my friend who recorded the sound files. Then he send them to me, as .wav. Then I editted them and exported them as .mp3. Can this have influence?
EDIT2: New finding. As I watched some videos on youtube about this, one guy just opened pakrat and pressed "Auto". Then it found all his soundfiles... This does not happen to me.
The only thing pakrat finds is that .txt file that I don't need
These are just the first 8 voice files which are used in the first map.
And then the first map's .BPS of course.