Custom Sounds in map - how to upload them in BSP? [SOLVED]

Avatar
beecake
484 Posts
Posted May 14, 2014
Hello fellow members.

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.

Advertisement
Registered users don't see ads! Register now!
Avatar
portal2companioncube
108 Posts
Posted May 14, 2014
Replied 6 hours later
I'm working on a map with custom sounds too. I also need to know this!
Avatar
josepezdj
2,386 Posts
Posted May 15, 2014
Replied 4 hours later
@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

Avatar
beecake
484 Posts
Posted May 15, 2014
Replied 40 minutes later

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!

Avatar
josepezdj
2,386 Posts
Posted May 15, 2014
Replied 50 minutes later

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?

Avatar
beecake
484 Posts
Posted May 15, 2014
Replied 12 minutes later

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.

Avatar
josepezdj
2,386 Posts
Posted May 15, 2014
Replied 11 minutes later
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".
Avatar
beecake
484 Posts
Posted May 15, 2014
Replied 38 minutes later

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.

Avatar
beecake
484 Posts
Posted May 16, 2014
Replied 1 day later
Sorry for doubleposting

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.

Avatar
josepezdj
2,386 Posts
Posted May 16, 2014
Replied 6 minutes later
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

Avatar
Lpfreaky90
2,842 Posts
Posted May 16, 2014
Replied 6 minutes later
maybe try the snd_rebuildaudiocache command in game?
Avatar
beecake
484 Posts
Posted May 16, 2014
Replied 36 minutes later

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?

Avatar
Arachnaphob
412 Posts
Posted May 16, 2014
Replied 2 hours later
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.
Avatar
beecake
484 Posts
Posted May 16, 2014
Replied 37 minutes later

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

Avatar
protoborg
288 Posts
Posted May 16, 2014
Replied 1 hour later
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.
Avatar
beecake
484 Posts
Posted May 16, 2014
Replied 1 hour later

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?

http://oi60.tinypic.com/30a4z6t.jpg

Avatar
josepezdj
2,386 Posts
Posted May 17, 2014
Replied 11 hours later

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:

  1. 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.

  2. 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'

Avatar
beecake
484 Posts
Posted May 17, 2014
Replied 1 hour later
I am using Audacity.
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

Avatar
josepezdj
2,386 Posts
Posted May 17, 2014
Replied 34 minutes later
Man, do you mind to post or pm me your BSP + sound files so I can check them, try to pack them and test them in game?
Advertisement
Registered users don't see ads! Register now!
Avatar
beecake
484 Posts
Posted May 17, 2014
Replied 37 minutes later
No, that shouldn't be a problem.

These are just the first 8 voice files which are used in the first map.
And then the first map's .BPS of course.