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

Discussion in 'Mapping Questions & Discussion' started by pi-ka, Sep 10, 2017.

?

What's your question Soldier?

  1. I teleported bread

    6 vote(s)
    42.9%
  2. how much?

    1 vote(s)
    7.1%
  3. I have done nothing but teleport bread for 3 days

    3 vote(s)
    21.4%
  4. VHERE? VHERE HAVE YOU BEEN SENDING IT?

    4 vote(s)
    28.6%
  1. pi-ka

    pi-ka L1: Registered

    Messages:
    43
    Positive Ratings:
    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!
     
  2. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    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.
     
    • Thanks Thanks x 1
  3. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,217
    I wonder why they never made MP3s loopable.
     
    • Agree Agree x 2
  4. henke37

    aa henke37

    Messages:
    1,876
    Positive Ratings:
    440
    Because there are technical issues with looping mp3 in general?
     
    • Agree Agree x 2
  5. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,217
    Winamp doesn't have any trouble with it.
     
    • Agree Agree x 1
  6. pi-ka

    pi-ka L1: Registered

    Messages:
    43
    Positive Ratings:
    8
    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...
     
  7. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    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.
     
    • Thanks Thanks x 1
    Last edited: Sep 25, 2017
  8. pi-ka

    pi-ka L1: Registered

    Messages:
    43
    Positive Ratings:
    8
    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...
     
  9. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    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.
     
Tags: