How do I make custom music play in a selected zone of my map?

What's your question Soldier?

  • I teleported bread

    Votes: 8 44.4%
  • how much?

    Votes: 1 5.6%
  • I have done nothing but teleport bread for 3 days

    Votes: 3 16.7%
  • VHERE? VHERE HAVE YOU BEEN SENDING IT?

    Votes: 6 33.3%

  • Total voters
    18

pi-ka

L1: Registered
Jul 23, 2017
43
8
Hello, its me again, second question of the day!

I wanted to have a trading zone in my map, which could be accessed by both teams via their spawn, but in the trading hub I wanted to have this music play:
View: https://www.youtube.com/watch?v=GOkQrRn9434&t=
as a subtle trading music and a funny reference, I don't want it to be heard all across the map though, how do I even get started with sounds?

Thanks for being helpful in advance!
 
Mar 23, 2013
1,013
347
First, either convert the soundtrack to mp3 or .wav and put it in your sounds folder. .wav files are very large, but you can loop them. So if you want to loop it, you should edit the soundtrack from the video so that it doesn't play twice to avoid unecessary big files. You can do this with GoldWave.

Now to play it in your map you could either use an ambient_generic which will make the sound emit from a specific point or you could create a custom soundscape. With the soundscape you could fade the soundtrack in as background music while players are in the area where it is supposed to play and it won't sound like the soundtrack comes from a specific position. So it's just like background music in some a video game.

If you want to keep the file small, you can make it an mp3 and compile it in ~ 128 kbit/sec if you don't mind if the soundtrack doesn't loop.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
I wonder why they never made MP3s loopable.
 

henke37

aa
Sep 23, 2011
2,075
515
Because there are technical issues with looping mp3 in general?
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Winamp doesn't have any trouble with it.
 

pi-ka

L1: Registered
Jul 23, 2017
43
8
First, either convert the soundtrack to mp3 or .wav and put it in your sounds folder. .wav files are very large, but you can loop them. So if you want to loop it, you should edit the soundtrack from the video so that it doesn't play twice to avoid unecessary big files. You can do this with GoldWave.

Now to play it in your map you could either use an ambient_generic which will make the sound emit from a specific point or you could create a custom soundscape. With the soundscape you could fade the soundtrack in as background music while players are in the area where it is supposed to play and it won't sound like the soundtrack comes from a specific position. So it's just like background music in some a video game.

If you want to keep the file small, you can make it an mp3 and compile it in ~ 128 kbit/sec if you don't mind if the soundtrack doesn't loop.

I would actually like to loop it, but where do I put the .wav file then? and how do I download it? I also have no idea how to select said music with the trigger brush I'm using...
 
Mar 23, 2013
1,013
347
Buy the soundtrack. Or convert the video with something like clipconverter.cc for example or something that already converts to .wav.
Since I use clipconverter.cc I also have to turn it from mp3 to .wav, I use AudaCity or GoldWave for that but I recomend you using GoldWave as you can also put loop cues into the file which you will need. more info about loop cues here: https://developer.valvesoftware.com/wiki/Looping_a_Sound

Also I recommend cuting the soundtrack. in the video the soundtrack is looped once, so it's twice as big as needed. Just cut it where it loops in your sound editing software.

Actually, because I have nothing better to do I'm so generous I just did it myself. I cut the track once at 3:12 where it loops, and also at 0:54. So you have a shorter version to safe file size! Both versions will loop smoothly. I also exported both the full and the short version three times in 44100Hz, 22050Hz and 8000HZ. I dont know if they all work in Source and if you don't mind using lower quality, but they take less space! Also the 8000Hz version sounds like it's coming from an old radio so maybe it fits into the tf2 theme?

Here's the download: https://puu.sh/xC7NH/01d0033465.rar You're welcome.

Contains 6 files:
shop8000hz.wav - 5.8MB
shop22000hz.wav - 16MB
shop44000hz.wav - 32MB
shopshort8000hz.wav - 1.6MB
shopshort22000hz.wav - 4.6MB
shopshort44000hz.wav - 9.2MB

Go to your tf folder and create the following path: tf/sounds/ilovelamp/ and put the soundfiles in there.

to play the files I highly recommend you to look into custom soundscape creation but we can go cheap with ambient_generics. Just place an ambient_generic where you want and at "Sound Name" you click "browse" to open the sound browser. filter for "shop" and select the sound file you want it to play.
Uncheck all flags of the ambient_generic so it will always play where it is located without needing an input first.

EDIT:

Appearently source doesn't want to play 8000hz sound files. So if anyone is still reading this, try use 11025 Hz instead (half of 22050). this works, still kinda sounds like an old radio and is a lot smaller. If you want a better sound quality, stick to 22050Hz.
 
Last edited:

pi-ka

L1: Registered
Jul 23, 2017
43
8
Buy the soundtrack. Or convert the video with something like clipconverter.cc for example or something that already converts to .wav.
Since I use clipconverter.cc I also have to turn it from mp3 to .wav, I use AudaCity or GoldWave for that but I recomend you using GoldWave as you can also put loop cues into the file which you will need. more info about loop cues here: https://developer.valvesoftware.com/wiki/Looping_a_Sound

Also I recommend cuting the soundtrack. in the video the soundtrack is looped once, so it's twice as big as needed. Just cut it where it loops in your sound editing software.

Actually, because I have nothing better to do I'm so generous I just did it myself. I cut the track once at 3:12 where it loops, and also at 0:54. So you have a shorter version to safe file size! Both versions will loop smoothly. I also exported both the full and the short version three times in 44100Hz, 22000Hz and 8000HZ. I dont know if they all work in Source and if you don't mind using lower quality, but they take less space! Also the 8000Hz version sounds like it's coming from an old radio so maybe it fits into the tf2 theme?

Here's the download: https://puu.sh/xC7NH/01d0033465.rar You're welcome.

Contains 6 files:
shop8000hz.wav - 5.8MB
shop22000hz.wav - 16MB
shop44000hz.wav - 32MB
shopshort8000hz.wav - 1.6MB
shopshort22000hz.wav - 4.6MB
shopshort44000hz.wav - 9.2MB

Go to your tf folder and create the following path: tf/sounds/ilovelamp/ and put the files in there.

to play the files I highly recommend you to look into custom soundscape creation but we can go cheap with ambient_generics. Just place an ambient_generic where you want and at "Sound Name" you click "browse" to open the sound browser. filter for "shop" and select the sound file you want it to play.
Uncheck all flags of the ambient_generic so it will always play where it is located without needing an input first.

Thanks for the help, I really appreciate it, I also downloaded GoldWave to edit the sounds, but I couldn't work it out! The next problem is that I have NO idea how to make a custom soundscape, I think I'll just go with ambient_generic-s I guess, and, is it supposed to stay as a .rar file? because for some reason when I open the downloaded file, it opens up internet explorer (even though I use chrome) and my computer starts downloading THE SAME FILE (what the heck? how am I supposed to put the sounds in the map when I can't open the file: moosic.rar?) and what map am I supposed to put it in? I only recieved one file, which when I open it, sends me to the page to download said file, I appreciate that you edited the file for me, but I can't use it for some reason, so I might need some more help...
 
Mar 23, 2013
1,013
347
How new are you to the internet? :p

A rar file is a compressed format that can pack entire folders with multiple files so I can upload multiple things in one go, plus the filetype makes the data smaller while it is in rar format. Perfect for a quick upload. (it's basicly what .zip .7zp files are if you know what that is) To unpack those files you need winrar or 7zip (both free software) to revert the rar to what it originally was. If you have something like that on your PC already, right click moosic.rar and click "unpack here" to put the files in the archive in the folder where the rar is currently in.
Then you just need to follow the steps I described before.