IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Loudest possible volume for an audio file?
WAZAAAAA
post Jun 21 2013, 08:36
Post #1





Group: Members
Posts: 6
Joined: 29-April 13
Member No.: 107887



So I would like to make a short audio file that has the virtually highest possible volume for the whole duration of it. How can I achieve that?

I'm trying some stuff with Audacity but I'm finding ways to make the volume higher and higher continuously.
Also, using lossless codecs such as WAV and FLAC gives a better result?

By the way, with all these tests... ouch my ears. Someone more knowledgable save me I don't want to test this anymore duh
Go to the top of the page
+Quote Post
Kohlrabi
post Jun 21 2013, 08:48
Post #2





Group: Super Moderator
Posts: 1146
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



QUOTE (WAZAAAAA @ Jun 21 2013, 09:36) *
I'm trying some stuff with Audacity but I'm finding ways to make the volume higher and higher continuously.
Also, using lossless codecs such as WAV and FLAC gives a better result?
The closest I can imagine you're looking for is to create a square wave with half the sampling frequency of your file, at an amplitude of 1.0. But what are you trying to achieve? And I don't understand the remark about lossless encoding, this is fairly orthogonal to that.

QUOTE (WAZAAAAA @ Jun 21 2013, 09:36) *
By the way, with all these tests... ouch my ears. Someone more knowledgable save me I don't want to test this anymore duh
Who is forcing you to do them? blink.gif


This post has been edited by Kohlrabi: Jun 21 2013, 08:50


--------------------
It's only audiophile if it's inconvenient.
Go to the top of the page
+Quote Post
WAZAAAAA
post Jun 21 2013, 08:59
Post #3





Group: Members
Posts: 6
Joined: 29-April 13
Member No.: 107887



QUOTE (Kohlrabi @ Jun 21 2013, 08:48) *
The closest I can imagine you're looking for is to create a square wave with half the sampling frequency of your file, at an amplitude of 1.0. But what are you trying to achieve? And I don't understand the remark about lossless encoding, this is fairly orthogonal to that.
What do you mean with "half the sampling frequency of my file"? I'm working with a 44100Hz file, should I switch to 22050?
Also, I've asked if lossless codecs were better because lossy codecs can... you know, reduce the quality of the audio and mess up with my file.

Does it make a difference if I use the Mono or Stereo option? What's the loudest?

I'm inexperienced in all of this, so excuse me if I'm asking stupid things. What I'm trying to achieve is having a file that I can use as a "joke".

QUOTE (Kohlrabi @ Jun 21 2013, 08:48) *
Who is forcing you to do them? blink.gif
No one, I was just joking and asking for support there.

This post has been edited by WAZAAAAA: Jun 21 2013, 09:03
Go to the top of the page
+Quote Post
db1989
post Jun 21 2013, 09:12
Post #4





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



By definition, the loudest possible amplitude is represented by a signal that consistently peaks at +1 and troughs at –1, a.k.a. 0 dBU/full scale, played through software and hardware stages all of which are set to maximal volume.

Beyond that, you can amplify the signal past those limits, but the exceeding peaks/troughs are clipped to flat tops at +/– 1. This can make the signal sound louder due to perceptual effects, but you sacrifice quality. This might explain why so many of the ‘shock’ sites have such distorted audio. Anyway, the perceptual increase in volume only applies to a certain point.

Before doing that, the first thing to try is to get a compressor and a limiter (maximiser) and process the file through those. This combination will squash out dynamics to make things louder on average. This is how many modern recordings are mistreated, sometimes even invoking pure clipping as described above: you might have heard of the ‘loudness war’.

QUOTE
What do you mean with "half the sampling frequency of my file"? I'm working with a 44100Hz file, should I switch to 22050?
Again, by definition, the highest frequency that can be represented by a digitally sampled file is just (actually, an infinitely small distance) below the sampling frequency (fs) divided by two. A frequency of fs/2 can ‘sort of’ be represented but not really, for it’s actually ambiguous. This is the Nyquist/Shannon sampling theorem.

And since I’ve mentioned a theorem just three paragraphs in tongue.gif: Short of just applying amplification to full scale and beyond, you might have to read up on some basics of digital audio. It depends how dedicated you are to this prank! wink.gif Perhaps a really effective one would also try to force all the recipient’s volume controls to full (or beyond?), but even if that were possible, it would involve a whole other set of skills.

This post has been edited by db1989: Jun 21 2013, 09:14
Go to the top of the page
+Quote Post
2Bdecided
post Jun 21 2013, 09:21
Post #5


ReplayGain developer


Group: Developer
Posts: 5357
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



Generate white noise, amplify by 100dB, save to a normal 16-bit wave file. That usually does the trick in most audio editors.

A 0dB FS 3.5kHz sine wave is the loudest pure tone (because human ears are most sensitive around 3.5kHz). Make it a square wave and it'll sound a little louder.

Take your pick.

Cheers,
David.
Go to the top of the page
+Quote Post
WAZAAAAA
post Jun 21 2013, 11:35
Post #6





Group: Members
Posts: 6
Joined: 29-April 13
Member No.: 107887



Thanks to everyone, especially to 2Bdecided, you're awesome, I now have what I needed. I played the file with VLC, set the player volume to 200%, and as expected, there was no audible difference I could notice when playing the file because it's already loud as hell. But hey, if I did something wrong I'm still open to your wisdom pills.

So I basically generated with Audacity a 10 seconds long note with these settings: Square Wave - 3500Hz Frequency - Amplitude 1, and this is the result:
http://www.mediafire.com/play/e77spkt7cmwi...withdespair.ogg

^Btw, it's not in WAV because for some reason the file would get corrupted, so I picked FLAC instead and it worked, but then I thought why don't I also try lossy codecs like MP3 and OGG for the sake of it. MP3's quality seemed pretty shitty even with the maximum settings, while with OGG the audio was virtually identical to the original and had a lower file size too, so I went for the excellent OGG.

Thank you again, hydrogenaudio is simply the best.

This post has been edited by WAZAAAAA: Jun 21 2013, 11:36
Go to the top of the page
+Quote Post
dhromed
post Jun 21 2013, 11:44
Post #7





Group: Members
Posts: 1339
Joined: 16-February 08
From: NL
Member No.: 51347



QUOTE (WAZAAAAA @ Jun 21 2013, 12:35) *
I played the file with VLC, set the player volume to 200%, and as expected, there was no audible difference


VLC +100% volume is a boost beyond 1, but if your OS is Windows 7 or 8, there's an intrinsic limiter active that can completely nullify that boost.

You could always social-engineer your victim into turning up their own volume, such as prefacing the sound with a whisper, or some quiet passages from classical music.

This post has been edited by dhromed: Jun 21 2013, 11:48
Go to the top of the page
+Quote Post
Kohlrabi
post Jun 21 2013, 11:46
Post #8





Group: Super Moderator
Posts: 1146
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



QUOTE (WAZAAAAA @ Jun 21 2013, 12:35) *
MP3's quality seemed pretty shitty even with the maximum settings, while with OGG the audio was virtually identical to the original and had a lower file size too, so I went for the excellent OGG.
MP3 was not designed to encode square waves/noise but music. Still, I wonder how you can assess the quality of MP3 encoding using a pure tone.


--------------------
It's only audiophile if it's inconvenient.
Go to the top of the page
+Quote Post
WAZAAAAA
post Jun 21 2013, 12:16
Post #9





Group: Members
Posts: 6
Joined: 29-April 13
Member No.: 107887



QUOTE (dhromed @ Jun 21 2013, 11:44) *
VLC +100% volume is a boost beyond 1, but if your OS is Windows 7 or 8, there's an intrinsic limiter active that can completely nullify that boost.
Oh is that so. Well at the moment I'm on a Windows XP Service Pack 3, and if I change the player to 200% with other files, the volume increases.
QUOTE (dhromed @ Jun 21 2013, 11:44) *
You could always social-engineer your victim into turning up their own volume, such as prefacing the sound with a whisper, or some quiet passages from classical music.
Classic. For both the music genre and the method hah. I tell you not to worry about that, I know ways to implement the loud thing.



QUOTE (Kohlrabi @ Jun 21 2013, 11:46) *
MP3 was not designed to encode square waves/noise but music. Still, I wonder how you can assess the quality of MP3 encoding using a pure tone.
I've played both the original and the MP3 versions, and the MP3 sounded different, the sound was slightly lower. I could confirm this by playing the FLAC and the OGG at the same time. If I played only OGG, the sound was the same as FLAC. If I played FLAC, the sound was the same of OGG. If I played both at the same time, there would be NO difference at all. But, if I played MP3 and FLAC at the same time, there would've been a pretty clear audible difference.

Additionally, it seems that the conversion to MP3 ate my first 50 milliseconds of the file, and made the file 30 milliseconds longer for some reason.


This post has been edited by WAZAAAAA: Jun 21 2013, 12:18
Go to the top of the page
+Quote Post
db1989
post Jun 21 2013, 12:47
Post #10





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Clearly, an encoder cannot create audio where none existed to begin with, so the file has been shifted later in time and cut by at most 20 ms.

As for why? Probably well-known side-effects of MP3 as a format and/or a careless decoder in Audacity.
Go to the top of the page
+Quote Post
Porcus
post Jun 21 2013, 13:17
Post #11





Group: Members
Posts: 1993
Joined: 30-November 06
Member No.: 38207



QUOTE (WAZAAAAA @ Jun 21 2013, 13:16) *
[...] sounded different, the sound was slightly lower.


That is why you align volume when you compare sound quality. Otherwise the slightly louder one tends to be perceived as better, everything else equal.

If you use foobar2000's ABX component, it will do volume alignment for you.


QUOTE (WAZAAAAA @ Jun 21 2013, 13:16) *
Additionally, it seems that the conversion to MP3 ate my first 50 milliseconds of the file, and made the file 30 milliseconds longer for some reason.


The MP3 format does, at the outset, not provide for any (integer) number of samples, only integer number of mp3 frames – anything else is achieved by retrofitted “hacks” to the format.


--------------------
One day in the Year of the Fox came a time remembered well
Go to the top of the page
+Quote Post
TomasPin
post Jun 21 2013, 20:56
Post #12





Group: Members
Posts: 204
Joined: 5-June 13
From: Argentina
Member No.: 108508



Not long ago I made some experiments with applying ReplayGain values to MP3 files, as I was playing them on a feature phone with no support for those tags whatsoever. I found that if you edit the value of the track or album gain to, say, +10 or +20 decibels and then you apply that value to the file it sounds really loud without producing audible distortions when played back*. I read on the matter and found the reason for that is MP3 and most lossy audio codecs work in floating-point internally.

Perhaps you could download foobar2000 and try that. You'll have to hold shift when right-clicking the file to make the option to edit tag value show up under the ReplayGain context menu.

*Hope I'm not talking baloney here, everybody feel free to correct me.

This post has been edited by TomasPin: Jun 21 2013, 21:00


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
saratoga
post Jun 21 2013, 22:09
Post #13





Group: Members
Posts: 5147
Joined: 2-September 02
Member No.: 3264



Transform codecs do not use integer sample values internally, no, but the output to the DAC is ultimately going to be an integer. If boosting the volume up +20 dB didn't add clipping, you've probably got the "prevent clipping" option enabled in your replaygain program.
Go to the top of the page
+Quote Post
TomasPin
post Jun 21 2013, 22:55
Post #14





Group: Members
Posts: 204
Joined: 5-June 13
From: Argentina
Member No.: 108508



QUOTE (saratoga @ Jun 21 2013, 18:09) *
Transform codecs do not use integer sample values internally, no, but the output to the DAC is ultimately going to be an integer. If boosting the volume up +20 dB didn't add clipping, you've probably got the "prevent clipping" option enabled in your replaygain program.


I was applying the value to the file (= changing the file), not using a ReplayGain-enabled program to play them. I don't know how foobar handles that, perhaps it does prevent the audio from clipping but wouldn't that mean it won't be as loud as they were? The files were originally peaking at 0 dbfs and had values of around -5db if I remember correctly (before I edited the tags).

Edit: And if most portable players (be it dedicated players or cellphones, smartphones, etc) output in integer values, don't they truncate the peaks above 0db? If so it should have sounded terribly distorted, and it did not (well, not terribly). Interesting...

This post has been edited by TomasPin: Jun 21 2013, 23:04


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
WAZAAAAA
post Jun 22 2013, 06:16
Post #15





Group: Members
Posts: 6
Joined: 29-April 13
Member No.: 107887



QUOTE (Porcus @ Jun 21 2013, 13:17) *
That is why you align volume when you compare sound quality. Otherwise the slightly louder one tends to be perceived as better, everything else equal.
Well, in my specific case, louder=better

QUOTE (Porcus @ Jun 21 2013, 13:17) *
If you use foobar2000's ABX component, it will do volume alignment for you.
That's what I just did, and well it was already hard to distinguish between the before two but now it was impossible
Go to the top of the page
+Quote Post
Woodinville
post Jun 22 2013, 07:46
Post #16





Group: Members
Posts: 1414
Joined: 9-January 05
From: In the kitchen
Member No.: 18957



QUOTE (WAZAAAAA @ Jun 21 2013, 00:36) *
So I would like to make a short audio file that has the virtually highest possible volume for the whole duration of it. How can I achieve that?

I'm trying some stuff with Audacity but I'm finding ways to make the volume higher and higher continuously.
Also, using lossless codecs such as WAV and FLAC gives a better result?

By the way, with all these tests... ouch my ears. Someone more knowledgable save me I don't want to test this anymore duh


Do you want the highest energy or the highest loudness?


--------------------
-----
J. D. (jj) Johnston
Go to the top of the page
+Quote Post
db1989
post Jun 22 2013, 09:27
Post #17





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (WAZAAAAA @ Jun 22 2013, 06:16) *
QUOTE (Porcus @ Jun 21 2013, 13:17) *
That is why you align volume when you compare sound quality. Otherwise the slightly louder one tends to be perceived as better, everything else equal.
Well, in my specific case, louder=better
Yes, but what Porcus means is that there is also a well-known psychoacoustic phenomenon whereby people judge subliminally louder versions of otherwise identical signals as sounding better.

QUOTE
QUOTE (Porcus @ Jun 21 2013, 13:17) *
If you use foobar2000's ABX component, it will do volume alignment for you.
That's what I just did, and well it was already hard to distinguish between the before two but now it was impossible
Q.E.D. tongue.gif
Go to the top of the page
+Quote Post
jkauff
post Jun 22 2013, 17:56
Post #18





Group: Members (Donating)
Posts: 164
Joined: 1-October 01
From: Doylestown, PA
Member No.: 145



This is interesting to me because I bought a new car that can play MP3 and AAC files, but doesn't support Replay Gain. I have quite a few files that are not loud enough when I'm driving with the windows open, especially classical guitar recordings.
Go to the top of the page
+Quote Post
stephan_g
post Jun 22 2013, 22:22
Post #19





Group: Members
Posts: 220
Joined: 6-June 10
From: Bavaria
Member No.: 81240



They weren't smart enough to include a dynamic range compressor in the radio? Having to keep a second DRC'd version of stuff is such a hassle.

I probably would resort to using the analog input with some Rockbox'd player, using RB's built-in compressor.
Go to the top of the page
+Quote Post
knutinh
post Jun 24 2013, 07:27
Post #20





Group: Members
Posts: 570
Joined: 1-November 06
Member No.: 37047



The (e.g. CD) format itself is amplitude-limited to +/- "1", allowing for inter-sample overshoots depending on the D/A-converter/resampler used at the receiver.

So the question can perhaps be formulated as "how much perceived loudness can a waveform that is amplitude-limited cause?". For that, a square-wave that has its fundamental right in the most sensitive part of our hearing (like suggested by 2BDecided) sounds like a good starting-point.

Not sure how that compares to white noise that has been bandpass-filtered by the inverse of the C-weighted sensitivity curves, then amplified until some undetermined amount of samples are clipped at +/-1?

-k
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th December 2014 - 15:55