Page 1 of 2

Map Sounds Tutorial

Posted: Tue Oct 28, 2014 7:32 pm
by timakro
Map Sounds Tutorial
written by DoNe, slightly edited by Index

As of client version 2.x you can use sounds in maps. The feature was coded by BeaR. His idea was to make little environmental sounds like singing birds or wind possible for maps. You can only hear the sounds if you use DDNet client. You can change the volume of map sounds for your client and even turn them off. Because only players using the DDNet client can hear the sounds you shouldn't use them to give information the players have to know. Map sounds are included to a map in the Opus(.opus) filetype.

How to convert my own sound to Opus?

The most music editing programs support the filetype Wav. Use this programm to convert Wav to Opus: http://www.foveon.de/sonstiges/opusdrop/index.htm. You can also use this online converter which supports almost every format for your input sound: http://audio.online-convert.com/convert-to-opus. Your output file should end with ".opus". Now put this file into your mapres directory.

Read a detailed explanation about opus: viewtopic.php?p=26734#p26734

How to include my sound to a map?

In editor sounds are handled similar to quads. Klick on the button that switches between images, sounds and layer management until you get to the sounds section. You should see your sound file in the file browser. Add it like you would add a image and don't forget to embedd it. Switch back to layer management and rightclick on any group. Click on "Add sound layer". Rightclick on your new layer and select your sound file as you would do it with a quad layer. After that the "Add Source" button at the top right will be clickable. Click on it and a new sound source will appear. You can move it like a quad by clicking on the green dot. Rightclick on the green dot to modify your sound source. You can decide if the sound will loop or just play when you enter the sound circle. You can change the delay that is waited when you enter the sound circle until the sound is played. The sound will get louder if you get closer to the middle of the sound circle. You can change the radius of the sound circle by changing the distance. A sound source can also have a position envelope. It will work like on quads and just move the sound center around. You can also add a sound envelope if you created one.

How to use sound envelopes?

Sound envelopes control the volume of a sound. They are very similar to the other envelope types. In the envelopes menu you can click "Sound+" to add a sound envelope. The x-axis controls the time and the y-axis the volume of your sound.

Re: Map Sounds Tutorial by DoNe

Posted: Tue Oct 28, 2014 11:52 pm
by deen
We're switching away from wavpack to opus for map sounds. Have a look at a nice comparison of Opus with some other codecs. Here's how to convert your sound files to opus for using them in DDNet maps:
  • Choose VBR encoding and opus filetype
  • Try out the lowest bitrate
  • Increase the bitrate until it sounds good enough
You can use these tools to do this:
Graphical
  • Use an Online converter
  • Use an all-in-one tool like WinFF, make sure to choose opus as the output codec.
  • First convert the sound to .wav, then use OpusDropMP to convert to opus
Command line
  • Code: Select all

    ffmpeg -i input.wav -b:a 6k output.opus
  • First convert the sound to .wav, then use the commandline tool opusenc like this:

    Code: Select all

    opusenc --bitrate 6 input.wav output.opus

Re: Map Sounds Tutorial by DoNe

Posted: Thu Oct 30, 2014 5:05 pm
by Aoe
Wow nice, is there any map with this feature yet?

Re: Map Sounds Tutorial by DoNe

Posted: Thu Oct 30, 2014 6:38 pm
by imp
lol, I didn't even realise that this feature had been released :D

Re: Map Sounds Tutorial by DoNe

Posted: Thu Oct 30, 2014 7:22 pm
by Kintaro*
Aoe wrote:Wow nice, is there any map with this feature yet?
Aoe i alreay created a map,
idk if its already on test server or if it will be realeased on ddnet anyway^^

Re: Map Sounds Tutorial by DoNe

Posted: Sun Nov 02, 2014 7:17 pm
by Aoe
Kintaro* wrote:
Aoe wrote:Wow nice, is there any map with this feature yet?
Aoe i alreay created a map,
idk if its already on test server or if it will be realeased on ddnet anyway^^

https://www.youtube.com/watch?v=kIfOjkB17BA

Re: Map Sounds Tutorial by DoNe

Posted: Tue Jan 27, 2015 11:20 pm
by Bossk
I have music in my winning room, but I'm wondering why just looping works.

-loop off
pan off/on nothing happens when entering soundzone

-loop on
pan off/on sound is looping when entering sound zone

I ask me what "pan" is for and why I can't configure that the sound starts playing and stopps afterwards if u enter a zone.

Re: Map Sounds Tutorial by DoNe

Posted: Wed Jan 28, 2015 5:37 am
by Alvin Risk
Pan its panorama.

Re: Map Sounds Tutorial by DoNe

Posted: Wed Jan 28, 2015 11:39 am
by BeaR
Panning: The audio signal will be split into two stereo channels and the volume will be adjusted for each channel according to your position in the audio field.
So e.g if you stand on the left side of the audio source, the right channel will have an higher volume than the left one and vice versa

About your second question: There is no support some sort of event triggering for OnEnter/OnLeave (same for animations)

Re: Map Sounds Tutorial by DoNe

Posted: Wed Jan 28, 2015 12:33 pm
by Bossk
Thx for your answer BeaR!

Maybe i missunderstood this
You can decide if the sound will loop or just play when you enter the sound circle.