For those who have tried, you will know it is very hard to have looping sounds/music throughout your entire map.
First of all, you need your music. This can be of whatever length you like. Next we need to convert it into a format the game can understand: wave/pcm. I used dbPoweramp converter which can be found
here. The game is a bit picky about what type of wave files it likes: I recommend using the 'Radio Quality' setting, or 22050Hz, 8 bit, mono. Your converted file should be 2 to 8MB in size. Previously such sizes would have not been feasible but with fast UDP downloads that problem is solved. Place this file in pball/sound/<yourname>/. Give it a good short name like 4winds.wav or ultradancebeetz.wav.
Next we need to get it in the map. Open up your map and make a target_speaker. Put it anywhere you want, within the bounds of your map. Enter the following keys and values, replacing yourname and soundname with the directory and file you created earlier:
'noise' '<yourname>/<soundname>.wav'
'attenuation' '-1'
'targetname' 'music'
Now we must start and loop the sound. We will use a func_timer to do this. Create a func_timer and give it the following keys, where length is the length of your music in seconds (3:30 would be 210):
'target' 'music'
'wait' '<length>'
'targetname' 'musictimer'
Finally, we need to set off the timer. It only needs to be set off once, so we will use a trigger_once. Create a brush and place it at a spawn point in your map, or the way out of a base. Somewhere that is often travelled. Select it. Select trigger_once from the entities box and click make entity. Now give it the following key:
'target' 'musictimer'
You should be all set. Export your map and test it. Finally, don't forget to include the sound file when you release your map!
-ViciouZ
Tutorial is GPL