This hasn't been tested on hardware and how ambient music may affect it, but I'm assuming that it's the same impact as the func_radio and how it loops music. However, the game will lag more if you have a larger file...so be careful.
Please know that the engine cannot handle large files!!
1. Music to be sampled. Don't try to have whole songs. A simple basic tune loop will be fine.
2. An old old old version of Cool Edit. This is Freeware, not warez. The file location will prompt your browser to not want you to continue. You can quit now or you can do this, it doesn't matter to me, it's your computer.
3. Audacity or any audio manager, I prefer it because it's free.
I will be using ScatterBox's "NZP Theme" available on Soundcloud, and be butchering it in order to make it loop. Here.
1. What we're going to need first is to download the audio file you need, which can be done in a variety of ways. Do one of them.
2. Open Audacity, select "File --> Import" and select your audio.
If your file has two sets of clips, then your file is stereo, not mono, and therefore the engine will not be able to read it. Select all and follow the image below to convert it to mono.
3. Select your selection of audio you wish to sample and edit it so that the track flows pretty seamlessly. I will not be doing this for you. Good luck. Shift + Spacebar will loop a track in Audacity so that you can match up amplitudes or whatever you need.
4. Go to the bottom right, and change the bitrate to around 11K Hz to reduce filesize. This is coming out of a PSP's speakers, so don't fret.
5. Export your audio.
6. Open up Cool Edit and close any demo track that it automatically opens (if it's your first time). Open the exported audio you recently produced and hit "Edit --> Select Entire Wave." Select "Sampler Info" from the View tab.
7. Generate an INFINITE loop by smashing that mf-ing "New" button on the bottom left to generate "Loop 1" and hit the "Infinite" radio button. Then smash that "Okay" button.
8. Save and export as a different filename in the nzp/sound/ambience/ folder.
9. Open up a map editor and place the function "info_ambient" and for the "noise" variable, put "ambience/~~~yourfile~~~.wav
Build map and listen to it play.