1

I'm dealing with an audio anomalie. I have audio that is mastered quite loud, yet on some systems, it is too quiet. Boosting the audio file anymore causes clipping.

It would be fine, except for the fact that, in my project, a lot of other sounds are in use as well. Lowering the volume of everything to match this would make some stuff impossible to hear. And again, this doesn't happen on all computers, only some.

To compensate, can I boost audio in code? The SoundChannel I'm using is already at 1.0 volume (full), and I know I can't use that property to boost it further. Is there any way to raise the audio further in code?

(I'm using Flash Professional CS5.5, Adobe AIR 3, and ActionScript 3)

CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
  • Note, you can set the volume on a `SoundTransform` to be greater than 1. I've created a bug where I did that w/live voice audio. It's not too useful in normal cicumstances, but maybe it would work in this case. Note this [question](http://stackoverflow.com/questions/1030107/how-do-i-amplify-sounds-by-a-specified-number-of-decibels-in-as3) about using decibel values might be useful. – Sunil D. Jun 16 '12 at 00:55
  • 1
    Hi, thanks for the input. Yes, you can set the volume higher on a SoundTransform, however, no change will actually be made. I tried that, and I validated through the documentation that "1" is the effective maximum value. – CodeMouse92 Jun 16 '12 at 01:12
  • Great to know. I guess my bug may have been on the microphone gain side, not the playback volume :) I had very distorted audio. – Sunil D. Jun 16 '12 at 01:41

2 Answers2

-1

After some time, I've concluded that it is apparently not possible to boost sound volume above 1 (that is, to amplify) using Flash's API. While you can set SoundTransform to a number greater than 1, it will coerce to 1 nevertheless.

If anyone has information to the contrary, you are welcome to post the answer and I'll change which answer I've accepted if you solve the problem.

CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
  • (Downvoter: Please read the tooltip on downvote. "This answer is not useful." If you have information to the contrary on how you can reliably boost sound above 1 on the Flash API, please post it.) – CodeMouse92 Mar 26 '14 at 16:51
-1

You are correct. Sounds cannot be played at a volume above 1 (100%). However -- You can play two identical sounds simultaneously on different channels. This would effectively give you an audio boost above 1. But depending on the nature of the sound you may get some distortions from synchronization. If you're talking about a sound-effect without a lot of discernable Attack, you may get away with it. If you're talking about speech or percussive sound, your mileage may vary.

Bangkokian
  • 6,548
  • 3
  • 19
  • 26
  • If you are suggesting that "listening to it" is somehow an inadequate way of identifying a volume boost, then I think you should step away from your computer. You've been around technology too much today. I stand by my answer: Two identical sounds (or the same file with simultaneous calls to execute) will play at a volume that would be in excess of 100% for just one call. You seem to have made a criticism and downvoted me based on zero evidence to the contrary. Why do you say I am "leading people to confusion"? This is an effective strategy for a large number of sound scenarios. – Bangkokian Mar 23 '14 at 17:30
  • It's not that you don't want to argue, it's that you do not want to justify your position, which is incorrect. – Bangkokian Mar 24 '14 at 11:07
  • Two identical sound files played simultaneously will play at a higher volume than one of the files played solo. The results are clear. What sort of evidence would you like? You seem to be introducing some bizarre requirement that I provide you with a decibel meter analysis. Rather than attempt to verify my advice, you throw out a ridiculous requirement of "evidence" (the sound is obviously louder). Why don't you disprove my findings? If a technique makes text "red" would you ask for a spectrographic analysis? – Bangkokian Mar 24 '14 at 11:16
  • No need to get nasty about it. I just DID a spetrographic analysis on this, and whether or not it is "louder" is somewhat subjective. I used to do AV. I recorded single-channel and dual-channel playback and analyzed the spectrographs and meters... – CodeMouse92 Mar 25 '14 at 01:40
  • The actual net amplification was probably one or two decibels. However, I'd call this a "pseudo-amplification" because it actually introduced clipping into the audio, seemingly by overloading certain channels. Thus, while the spectrographs showed largely the same profile, some frequencies were higher. In short, a net gain of a couple decibels, with a significant loss in sound quality. – CodeMouse92 Mar 25 '14 at 01:42
  • FYI, I ran this test on music, so it had a wide range. Based on that, I would not say that this is an advisable means of boosting audio. When possible, re-render the original audio file at a higher level for boosting, to ensure the quality isn't fubar'd. No offense to you, Bangkokian. Clever hack [in a good way], but the barely detectable volume gain is outweighed by the significant quality loss. The "louder" perception comes from the introduced clipping, not from actual volume gain. (This is why he said not to trust "just listening", as perception can be tricked.) – CodeMouse92 Mar 25 '14 at 01:45
  • (Last point...sorry I had to pack it into four comments, here.) Theoretically, you could boost this up quite a ways this way, if you had a very durable sound clip, but keep in mind it would take a significant amount of memory to stream seven or eight simultaneous tracks, especially if that's on every sound. – CodeMouse92 Mar 25 '14 at 01:48
  • Agreed -- it's certainly not an optimal solution -- and it depends greatly on the scenario (as I stated in my original answer). We used this technique on a non percussive, weather sound effect where sync issues were not an issue. However I can't agree with your assessment that the sound gain is "barely detectable". We saw a large increase in volume. Are you sure you were playing on a new channel? – Bangkokian Mar 25 '14 at 06:32
  • Yes, I am totally sure. I loaded the sound twice, and loaded each instance into a separate channel. They were both recorded via stereo mix with the exact same settings, by the same program, successively. The numbers did not lie - the difference in volume between the two was, at most, three decibels. But, again, this can be percieved as more of a gain than is actually there, simply by the fact that certain frequencies were amplified more than others. It's paramount to running a sound through a mixer, and amping one frequency can have no net effect, but sound louder to some people. – CodeMouse92 Mar 25 '14 at 19:43
  • By the way, sync issues were not even a factor in my tests. The quality drop came from the introduction of clipping. It could be because I have a midstream-quality sound card. That is, of course, a major contributing factor in the "mileage may vary" issue, as most users have mid-to-low-quality sound cards. On that note, some sound cards may get a LOT more amp out of this method than others, which could be one factor here. But that's the issue with using this method: if the result is unpredictable from one system to the next, there are going to be a lot of issues. – CodeMouse92 Mar 25 '14 at 19:46
  • (By the way, scientifically, sound amplitude is not cumulative. If you have one sound played at 20 dB, and another sound played at 20 dB, they don't somehow merge to make a new sound that is 40 dB. You stay at 20 dB. Think of two speakers - together, they don't make sound louder. As far as I can tell, this method leverages hardware limitations to create a quick-and-dirty mix of the sound that is, in some cases, perceived as louder. In some cases, it is louder because of introduced clipping.) – CodeMouse92 Mar 25 '14 at 19:56
  • Yes, that's true. Sound amplitude is not cumulative, but it IS additive. eg: A 20 dB sound has a 10 Pa * 10^(20dB/10dB) = 1000 Pa pressure. If you take two 20 dB sounds that have a 2*1000 Pa pressure. Converting this back to decibels, the sound is log (2000 Pa / 10 Pa)*10 dB = 23.01 dB. Hence, you will see a rise in perceived volume from play-doubling. But like you said, you will not 'double' the amplitude. Of course, that's more of an output issue. With play-doubled files, I think it would need a db test. Having just re-checked, the perceived sound was indeed higher in our case. – Bangkokian Mar 26 '14 at 08:20
  • Interestingly, with your math there, you got just a 3dB net gain, which is approximately what I found in the above test (which did measure decibels, again.) Anyhow...interesting workaround, but this still is a risky programming maneuver, seeing as it is so conditional on A) sound, B) sound card, and C) memory. For all the effort, just re-engineer the sound. – CodeMouse92 Mar 26 '14 at 16:48