Why use db for unit of audio volume?

Discussion and feedback on Construct 2

Post » Sun Mar 09, 2014 3:23 pm

I have a small question, why use db for unit of audio volume? instead of a linear number.
B
108
S
26
G
266
Posts: 4,455
Reputation: 149,245

Post » Sun Mar 09, 2014 5:57 pm

Agree'd
It's very hard making sound controls when you're dealing with db.
(hard as in; I don't know how)
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Sun Mar 09, 2014 6:01 pm

It's not too hard to make a function to convert back and forth from db and a scale system (e.g. 0-100).

Scale = 100 * 10 ^ (dB / 33.2)
dB = -log10(100 / Scale) * 33.2
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Sun Mar 09, 2014 7:47 pm

sqiddster wrote:It's not too hard to make a function to convert back and forth from db and a scale system (e.g. 0-100).

Scale = 100 * 10 ^ (dB / 33.2)
dB = -log10(100 / Scale) * 33.2


"Not too hard"
But hey, it works!
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Sun Mar 09, 2014 7:58 pm

rexrainbow wrote:I have a small question, why use db for unit of audio volume? instead of a linear number.


It makes sense for some applications when dealing with signals that can take values over very large ranges, but for applications intended for PC or phone speakers I agree, it's not very useful.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Sun Mar 09, 2014 8:21 pm

@7Soul well it's not too hard once you know the formulas. I copied them off someone else in another thread :D
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Sun Mar 09, 2014 10:54 pm

sqiddster wrote:@7Soul well it's not too hard once you know the formulas. I copied them off someone else in another thread :D


I might add:
dB = -log10(100 / Scale) * 33.2 = log10(Scale/100)*33.2 I prefer the second one since you see directly that scale and dB have their increase and decrease related

also You forgot one thing.. 0, you have to take care of the 0%, since I think it is possible that C2 does a math error (log(0) does not exist)

EDIT: from where does that 33.2 comes from, I've always wondered?
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sun Mar 09, 2014 11:44 pm

I had checked the audio plugin, it used linear number inside. So it might have some reasons that @Ashley decided to use db instead of linear number at the interface of audio plugin.
B
108
S
26
G
266
Posts: 4,455
Reputation: 149,245

Post » Mon Mar 10, 2014 6:22 am

because DB are tought in audio engineering school. Often because of the non linear interpolation and the common measurement use world wide.

this is much akin to why did ashley set the colouring system using 1-100 and not the 1-255 that's common around the internet. Ashley sure got a lot of flak for that decision. At least DB is the common system used by all tools.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Mon Mar 10, 2014 6:40 am

@jayderyu

Not really all tools, the audio plugin will transfer db to linear number for internal function call.
And the players did not know the db, they might want to set the volume to 0.5 (linear number) directly.
So designer need to transfer the linear number to db at event sheet, then the audio plugin transfer db to linear number back.
B
108
S
26
G
266
Posts: 4,455
Reputation: 149,245

Next

Return to Construct 2 General

Who is online

Users browsing this forum: digitalsoapbox, Rastacity and 12 guests