I made this object to take care of this autofade. You init it with the sound
mc and update interval i ms.
You can then call it with (target volume, length of fade time and delay)
Hope you find it usefull:
class SoundAuto extends Sound{
private var intervalId:Number
private var targetFadeVal:Numb
Well, I have solved both the problems;
1) for the fadeIn / fadeOut question, I assume this solution: instead that
put the loadSound code on main timeline, I have done a new mc, with two
frame inside. At the first frame, insert the code below
stop();
track = new Sound();
track.loadSound("everybody.
I have tryed the andreas suggestion, but don't work. The jingle volume
continue to be the previous (fadingIn to 90).
But the strange news is another: if I do a test movie inside Flash, the
sound of jingle is loaded and faded (code below), but if I test within HTML
page, no sound is loaded...
How is
Basically yes :)
Flash has no notion of decibels - there are probably formulas out there to
try and approximate that logarithmic curve and apply it to your audio to get
a more natural response. Its a interesting topic at least ;)
e.dolecki
On 11/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
ok. are you talking about decibels being logarithmic and not linear? ie.
decibel * 2 doesn't mean "heard volume" * 2.
anyway this is getting off topic but i'm sure you're right about this
whole thing anyway :)..
eric dolecki wrote:
I guess I'm saying that any audio fading up or down should
I guess I'm saying that any audio fading up or down should probably not be
done linearly ever - while mathematically accurate, to the human ear it
doesn't sound right. You'll notice no change and then zm... a really
quick fade down... when what you wanted was something "even" if you know
what I
so then the code here would work since it's not "linear".
but i'm not sure what you mean by "linear adjustments prove to sound
highly inaccurate"? in this case i don't think it matters anyway since
it's just a small change of volume and he's probably not coding some
online dj mixing software.
I've found that linear adjustments prove to sound highly inaccurate -
or strange. You'll notice no difference, and then the change will be
quite abrupt. So be careful with these kinds of things - linear is
probably not the best way to go.
e.dolecki
On Nov 7, 2005, at 5:21 AM, [EMAIL PROTE
If you want to keep things simple, and the volume fade doesn't need to
be linear, couldn't you just run a soundUpdate function and keep track
of the volume in a variable. something like this:
var volume = 0;
var destVolume = 100;
setInterval(soundUpdate, 100);
function soundUpdate() {
Hi,
Here is a Sound prototype I often use. You can also easily set it as a
function in a sound class:
Sound.prototype.volumeTo=function(nTarget:Number,step:Number,post_func:Funct
ion){
var a=nTarget - this.getVolume();
var v=this.getVolume();
var dir=a/Math.abs(a);
if(this["_sound
In my movie, I have a jingle, that is loaded by this code:
code:---
---track = new Sound();
track.loadSound("everybody.mp3", true);
track.setVolume(0);
vol = 0;
fade = setInterval(fadeIn, 100);
function fadeIn() {
vol += 1;
tr
11 matches
Mail list logo