Controlling All Audio/video Volume
is there a way to control global audio volume in as3 ? I've several video and audio streams playing
and I want one volume slider to control all of the video and mp3 streams ... but it seems that audio for flv is controlled differently as mp3 ? or did I miss something
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 06-19-2008, 05:26 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Controlling The Volume Of A Audio Track
i've tried this;
new Sound();
s.attachSound("Restaurant2");
s.start();
s.setVolume(50);
but it controls ALL the audio playing in that movie, all i would like to do is set the volume for that particular track disregarding the others, is this possible...
nice one
leroy
Controlling Volume Of Audio With Keyboard
This is a bit of a crosspost but no one in audio came up with anything.
What I would like to do is control the volume of the movie with via the keyboard, say the '+' and '-' keys. Just wondering the best way to do this.
Thank you
Controlling Volume For Embedded Audio
I have a problem that someone may be able to help me with. I do a lot of audio/photo slide shows in flash. To get the audio and photos to synch up during the course of the slide show I have to put the audio directly on the timeline and put in the photos in the appropriate places to match the changes in the audio. I found a good tutorial a while back on how to build a volume slider in AS2 so I could control the volume of the sound on the main timeline but I can't get it to convert over to AS3.
My old volume controller basically looked like this:
within a MC instance name "knob" there is an action to make the knob slide:
ActionScript Code:
on (press){
startDrag("",false,0,0,50,0);
}
on (release, releaseOutside){
stopDrag();
}
on the timeline of the movieclip where "knob" and "track" reside there are 3 timeline actions
first frame:
ActionScript Code:
smooth_audio = new Sound();
knob._x = 25;
second frame:
ActionScript Code:
vol = knob._x*2;
smooth_audio.setVolume(vol);
third frame:
ActionScript Code:
gotoAndPlay(2);
This was a great tutorial and I'm sorry I lost track on who wrote it or I would site them here.
so I basically want to do the same thing using actionscript 3...
I have built a slider that I'm trying to use but I'm just not getting it to work right.
I have a slider that I built that I have used for other things and it would be awesome if I could build a similar functionality into it (I have a movieclips named "knob" and "track" wrapped inside another movieclip):
ActionScript Code:
stop();
var vertical:Number;
knob.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler);
knob.buttonMode = true;
function mouseDownHandler(evt:MouseEvent):void {
vertical = track.y + (track.height / 2 - 6);
knob.startDrag(true, new Rectangle(track.x, vertical, track.width, 0));
stage.addEventListener(MouseEvent.MOUSE_UP,mouseUpHandler);
}
function mouseUpHandler(evt:MouseEvent):void {
knob.stopDrag();
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseMoveHandler(evt:MouseEvent):void {
??????????????????;
}
I know the functionality should be built into the mouseMoveHandler but I'm not sure what that needs to be...do I need to make a soundChannel variable? other variables...as you can see I'm to up to speed on working with audio. If anyone can share any ideas for suggest a tutorial or something let me know...thanks!
Controlling Volume Of Audio On A Frame..
Hey guys,
If I put audio on the timeline, on actual frames, how can I adjust the volume of that particular volume? I am not using a Sound object, just importing the audio to my library, then selecting the frames I want it to play during, and setting it to stream or event.
I cant figure out how to make the volume louder.
Thanks!
Controlling The Volume Of A Streamed Audio File
hey,
I have a music file that i streamed in frame 1 of my movie, and i have a button in my movie that i want to control volume. How can i make it so when I click the button, it lowers the volume of the sound to 0? (i dont want to make it pause it, then the stuff in the movie wouldnt sync up. i want it to make the volume 0 so if they turn it back on, it continues to play in sync.)
Controlling The Volume Of A Streamed Audio File
hey,
I have a music file that i streamed in frame 1 of my movie, and i have a button in my movie that i want to control volume. How can i make it so when I click the button, it lowers the volume of the sound to 0? (i dont want to make it pause it, then the stuff in the movie wouldnt sync up. i want it to make the volume 0 so if they turn it back on, it continues to play in sync.)
Controlling A Video's Volume In AS3
I'm doing the right thing and abandoning AS2 altogether, but I keep getting stuck on things I used to know how to do. The latest is controlling a video's volume. Anyone know why this doesn't work?
Code:
var so: Sound= new Sound();
var audioChannel: SoundChannel= new SoundChannel();
var audioTransform: SoundTransform = new SoundTransform();
var video: Video = new Video(340,255);
var nc: NetConnection = new NetConnection;
nc.connect(null);
var ns: NetStream = new NetStream(nc);
var meta: Object = new Object()
meta.onMetaData = function(meta:Object)
{
trace(meta.duration);
};
ns.client = meta;
ns.soundTransform = audioTransform;
addChild(video);
video.attachNetStream(ns);
ns.play("flv/clip_01.flv");
button_mc.buttonMode = true;
button_mc.addEventListener(MouseEvent.CLICK,mute);
function mute(e:MouseEvent)
{
audioTransform.volume = 0;
trace("hit");
}
So obviously this doesn't work. What am I missing?
Thanks in advance.
Controlling A Video's Volume In AS3
I'm doing the right thing and abandoning AS2 altogether, but I keep getting stuck on things I used to know how to do. The latest is controlling a video's volume. Anyone know why this doesn't work?
Code:
var so: Sound= new Sound();
var audioChannel: SoundChannel= new SoundChannel();
var audioTransform: SoundTransform = new SoundTransform();
var video: Video = new Video(340,255);
var nc: NetConnection = new NetConnection;
nc.connect(null);
var ns: NetStream = new NetStream(nc);
var meta: Object = new Object()
meta.onMetaData = function(meta:Object)
{
trace(meta.duration);
};
ns.client = meta;
ns.soundTransform = audioTransform;
addChild(video);
video.attachNetStream(ns);
ns.play("flv/clip_01.flv");
button_mc.buttonMode = true;
button_mc.addEventListener(MouseEvent.CLICK,mute);
function mute(e:MouseEvent)
{
audioTransform.volume = 0;
trace("hit");
}
I've got like a stray sound object in there that I thought I might need, and a SoundChannel as well. Anyway, obviously this doesn't work. What am I missing or doing wrong?
Thanks in advance.
Controlling Video With Audio
I have a 10 second video clip that I have embedded into my flash document. The video plays automatically and loops forever. I then created a play, pause and stop button with behaviors to control the video. I then gave those same buttons actions that play, pause and stop an external mp3 file. I want the video to somehow read the audios length and time itself out to stop when the audio dose. I plan on changing the audio file on the server frequently and I want the videos length to update itself based off of the new audio clips length.
Controlling Audio In Embedded Video
I am using a few short embeded video clips with audio. The problem is that when the video was recorded it was right channel only and a little low. It is green screen video, now with an alpha that I am keying in Flash.
Is there a way to control the audio level of the embeded video? I can't seem to find out how to do it. I am having codec issues if I edit the video/audio in Premiere and then try to create an alpha with Ultra. So that isn't an option either.
There doesn't appear to be a way to target the audio only. How about actionscript?
Controlling Video Audio Levels
i need to ctrl the audio of a video clip, but im not sure how to do it
what actionscript do i need
i imagine i would need something like
_root.video_movieclip.soundlevels = 100%
or something like that
Controlling Speed Of Audio And Video Playback ?
Hi!
I would like to know if there is (or will be) a way with upcoming Flash CS4 or even with Adobe Flash Player 10 capabilities (or even with Adobe Pixel Bender) to control the speed of an audio or video playback.
For example being able to play some sound slower or faster and even adjusting audio pitch (and other audio filtering).
It's been a while that I've been looking for this (back to Flash Player 6 when Flash was part of Macromedia) and with all progress achieved since then I hope there is some accelerate and decelerate feature now.
Please let me know about it.
Question About Controlling Audio Through Streaming Video
Is there anyway to control the sound of a streaming .flv movie, without having to rely on the Media Components? Basically, is it possible to build your own set of media components? This is very easy to do if you embed the file locally, but I'm having trouble streaming it.
This is what I'm using to stream the media
Code:
var computeBW = true;
var nc:NetConnection = new NetConnection();
nc.onBWCheck = function (arg) {
return;
}
//---------------------------------------------------------------------
nc.onBWDone = function(bw) {
if(bw >= 300) {
ns.play("15607/19879_vid_hi")
trace("HighBandwidth");
}
else if(bw >=100) {
ns.play("15607/19879_vid_med")
trace("MediumBandwidth");
}
else {
ns.play("15607/19879_vid_lo")
trace("LowBandwidth");
}
}
//---------------------------------------------------------------------
nc.connect("rtmpt://video:80", computeBW);
var ns:NetStream = new NetStream(nc);
videoObject.attachVideo(ns);
ns.setBufferTime(2);
Now, In a button on the stage, shouldn't this in theory work?
Code:
on (press) {
ns.setVolume(0);
}
Does anyone know if there is any documentation on this subject floating around?
Problem In Controlling Audio In A Imported .mpg Video File To Flash
Hi there
I have imported a MPG clip to my flash movie, I am able to control movie adding PLAY a nd PAUSE buttons, but couldn't control the audio of the video file, if I used "stopallsounds" script it is only works to OFF the sound but it is not starting sound ON.
Anyone help me in controlling the audio of a video with Sound ON/OFF button
waiting for a quick reply
Thanks
Chary
Audio Volume Sliders For Multiple Channels Of Audio
I don't even know if this is possible, but I was wondering if there was any way you can set up volume sliders to control multiple channels of audio. For a project I'm working on I am going to have background audio and comentary. I want the user to be able to adjust the volume of both the background audio and the comentary. Is there any was I can make seperate sliders for each of those tracks of audio?
Thanks!
Controlling Volume
Hi,
I have a problem controlling sound object. I have a main movie that loads and controls submovies (external .swf) which contain flash movies with just sound. so basicly this project is a sound player. the problem is how to control the volume. I have tried 2 different approaches, but haven't got them to work. the first one was to use sound in a layer, but then you have no control to volume or any other property of the sound object. Then I tried to do it via action script and almost got it:
soundInstance = new Sound();
soundInstance.attachSound("mySOUND");
soundInstance.start(0,999);
works fine in a single movie, even when I export it.. but then when I load the movie clip from my main movie, nothing happens.. no sound.
Can anyone help me out?
Thanks,
Flashbuggy
Controlling Volume..
Hi all,
At the starting of the movie, I am attaching a sound name "bg"..
at the middle of the movie on click of a button I am attching a voice over id "vo"..
At the time the voiceover loads I am trying to decrease the volume of the "bg" to 10%.. But both the sound is getting reduced..
code..
on(release){
voice = new Sound();
voice.attachSound("vo");
voice.start();
bg.setVolume(10);
}
Is there any way to control one of the sounds volume..
Pls Help..
shibs_5..
Controlling The Volume
I am having trouble scripting for volume level control
What I have is main flash starting with external music in .swf format.
What I need is...
when different external "video" loads, I want the first frame of the "video" to turn down the volume level of loaded music .swf file.
is it something like _root.xxx.volume 0 (where xxx is instance name)?
how do I go about doing this?
Help needed badly.
Thx in advance
Controlling Volume In MX
How do I control the volume of a audio file in FX? I tried giving the sound clip and instance name but I don't know the code to control volume.
Controlling Overall Volume
I was wondering whether it's possible to simply control/mute the entire volume of a flash movie using ActionScript?
All I can find is how to limit single sound objects, but this needs to be universal to flash movies.
If so, is it possible to do it from an external movie/javascript snippet on the same page as the movie is embedded?
Controlling Volume Of A MC
Hello,
there is anyway to control volume from a MovieClip that contains audio?
or dows anybody know if would be possible to load a SWF instead of an MP3 into a Sound Object?
Any suggestions/help please?
Thanks!
Audio Volume
hello,
bare with me, i'm new at this actionscript stuff...
i'm working on a flash intro using flash mx-
I have two audio files. the first plays and upon completion a second audio file immediately follows. The second file is programmed to loop.
the second file sounds fine when it loops for the first time but after the initial loop the volume noticeably decreases.How do I keep the volume of this loop consistent? there is probably something wrong with my code...
function callback1() {
trace("mySound completed");
s2.start("SecondOffset,loop");
s2.start(0,999);
}
s1 = new Sound();
s1.attachSound("mySound");
s1.onSoundComplete = callback1;
s2 = new Sound();
s2.attachSound("mySound2");
s1.start();
thanks,
jenny
Audio Volume
I'm using this code to load background music ans set the volume.
s = new Sound( );
s.attachSound("music");
s.start(0, 99999);
s.setVolume(100);
When I have voiceover also I use this to lower the volume of the background music.
s.setVolume(20);
The problem is that this lowers the volume of the voiceover as well which is in an entirely different movieclip on a different Level.
Why does it do this and is there a solution so I can keep the volume of the voiceover hi?
Thanks
Controlling Pan & Volume Of More Than 1 Sound
Is it possible?......
What i want to do is with 'sound1' turn the volume down to 50 and pan to the right - while 'sound2' isn't affected
I can see how to do it for one sound but it seems to affect any sound i throw in to the movie.
Anyone seen anything about this?
thanks for your help
Controlling Volume Using Actionscript
can anyone help me here, i am in a tizz.
i need to control my sound using actionscript, not the envelope, for it loops, fading in and out etc. there are other layers, with other sounds. i have attached a variable, and a name to the sound i need to control, but it is controlling all other sounds, in other words, it is working as a 'global' control.
this is the script i am using:
name = new Sound();
name.attachSound("linkname");
name.start(0, 1000);
name.setVolume(20);
in following frames i may put:
name.setVolume(50);
i also have a fade out movie .. which is also 'globally' controlling all else.
what am i missing? what am i doing wrong?
thanx
bai
Controlling 2 Sounds' Volume
Greetings all.
I'm having a hard time controlling 2 separate sounds' volume. I'm trying to turn down the main looping sound once another sound effect begins. But once I do, it effects both of the sounds volume. Is there anyway to decrease the volume of 1 sound while not effecting the other?
Here's my attempted code:
On frame 1:
s = new Sound();
s.attachSound("intro");
s.setVolume(100);
s.start(0, 999);
On frame 50:
t = new Sound();
t.attachSound("ballgame");
t.setVolume(100);
s.setVolume(10);
t.start(0, 0);
Any help would be greatly appreciated.
Thanks in advance,
Tony
Controlling System Volume
Is there anyway to control the sytem volume through Flash? I can create a volume control for a movie however that really doesn't effect the system level. Any suggestions?
Thanks.
SoundObject: Controlling Volume
I have three frames in my main timeline. The first contains the preloader, the second is the entrance animation and the third is a menu loop. In the second frame (entrance animation), I've place this script on the main timeline in an "actions" layer:
backgroundAudio = new Sound();
backgroundAudio.attachSound("movieAudio");
audioVolume=70;
backgroundAudio.setVolume(audioVolume);
backgroundAudio.start(0, 99999);
In the third frame of the main timeline (menu loop), I have controls for the audio (ie. stop, play, volume, etc...) On the volume down button I have this script:
on (release) {
audioVolume=(audioVolume-5);
if (audioVolume<5) {
audioVolume = 1;
trace(audioVolume);
_root.backgroundAudio.setVolume(audioVolume);
_root.gotoAndStop("loop");
} else {
trace(audioVolume);
_root.backgroundAudio.setVolume(audioVolume);
}
}
The problem is, the first time I hit either the volume up or down buttons, it acts as though the initial volume is 0. In other words, the value I set for "audioVolume" (70), in the second frame, loses it properties when a button is pressed. It does start playing at 70 though if untouched, and after a button is pressed and it resets to 0, then all buttons function properly, but the first press destroys everything. How do I combat this?
Thanks for your time and help.
Controlling Sound Volume
Hi all,
I don't know that this is a newbie question, but I don't have a lot of Flash experience.
I followed Tim's tutorial here, and I embellished it a bit.
http://www.flashkit.com/tutorials/Au...1008/index.php
I want to add a volume control to it, but because of all the encapsulated movies that call each other and load, I am confused. It would be nice if I could control the master volume, but it looks like you can only control the volume of a sound object. That presents a problem, because the music here is streamed in the main timeline of one of the SWFs.
Is there a way to control volume if there is no sound object?
Thanks!
-Chris
Controlling Volume Without A Slider?
Hey all,
I'm looking for a way to control the volume of a streaming audio file *without* using a volume slider (i.e., having volume up/down buttons that will evaluate the current volume level and increase/decrease the volume by a given percentage each time they're clicked, and simply do nothing at all when the minimum and maximum volume reaches 0% and 100% respectively).
I've been playing around trying to figure it out, but I'm getting nowhere. Here's what I have thus far (A.S. editor hasn't complained, so I guess that's a good thing ):
// volume down
on (release) {
my_sound.getVolume();
if (my_sound.getVolume()>=0) {
stop();
} else {
if (my_sound.getVolume()<=1); {
my_sound.setVolume(this.my_sound.getVolume - 25);
}
}
}
// volume up
on (release) {
my_sound.getVolume();
if (my_sound.getVolume()<=100) {
stop();
} else {
if (my_sound.getVolume()>=0); {
my_sound.setVolume(this.my_sound.getVolume + 25);
}
}
}
I know "my_sound.setVolume(this.my_sound.getVolume + 25);" won't work, it's just there to show that I want to increase/decrease the volume by a quarter of the total each time.
Help would seriously be appreciated. Thanks guys!
Ryan.
Controlling External .swf Volume
I am trying to control the volume of numerous external .swf's containing audio from the root timeline. I have the external .swf's loading into a hidden MC on the main timeline. I would like to have a sliding volume control that will increase and decrease the volume. I have checked past threads and have only found postings referencing sounds loaded with the main .swf. Can anyone give me some advice?
Controlling Volume Embedded Mc
Hi,
I have movie in which several clips play and I need the ability to pause and play these clips, and mute and un-mute the volume.
I have the play and pause working from the root, but nothing I can figure out will turn off the volume of the embedded clip that's playing.
I've tried declaring a new sound in both the root and in the embedded clips and using the set volume command within the mute button.
_root.mySound.setVolume(0);
I have also tried attaching sounds to the sound object but this seems to make playing and pausing the clip a problem as stop and start, cause the clip to start playing from the begging.
I will be grateful for any insight.
Chris
Controlling Volume Of External .swf's
I use an mp3 player that loads external swfs as opposed to actual mp3s. They load just fine, but I can no longer control their volume with my slider. I created a globalsound Sound object that worked when loading mp3s. Does anyone have a way to control the volume of a movieclip?
Controlling Volume For The Entire .swf
Last edited by felisan : 2005-03-16 at 14:11.
hi flash-sharks.
i'm doing a .swf-file containing a video.
and then i am to do a mute button, but how do i mute the sound of a video, without stopping it?
i can use the stopAllSounds-action, but then i cannot start the sound again...
anyone who can figure this out for me ?
thanks
felisan
AS3 - Controlling Volume (not Typical)
Hey guys,
I'm using a Loader to place an external SWF into my project. The external SWF has a Video object on it that plays through when the clip is loaded.
I'm trying to control the volume of the externally loaded SWF. I've tried setting the .soundTransform property of the loaded SWF and the loaded SWF's parent, but none of that didn't work.
Anyone know what's going on here?
Thanks!!
Controlling Button Volume Via AS
Hi Folks,
I've been searching the forums trying to find a way to create a global volume controller for my sound effects (notably the button sound effects) but was unable to find a solution, so I came up with my own and I figure I'd share.
First of all, I really don't like the idea of having to use code for my button event sounds unless I really need to. Adding sounds via flash's timeline seems so much cleaner to me. The problem is that you can't use the Sound object to control timeline sounds that are in buttons (why, oh why??). However, you can control timeline sounds for Movieclips... the solution? Make each button state a Movieclip and add the timeline sound in the Movieclip! From there, its really simple - create the sound object as you normally would:
var s_sound = new Sound(target_mc*);
s_sound.setVolume(20);
*Note: target_mc is the movieclip containing your interface (which holds the buttons).
This will allow you to controll all sound events (in the target_mc) added via the timeline. If you want to add other sounds, (say background music) and have a separate controller for that, you'll need to make sure the background music target mc is outside of the s_sound target mc - or it will get grouped with them.
Hope this helps!
Shu
Controlling Volume Of Sound
hi
i have a movie with a lot of sounds in different scenes. The sounds are in different layers. How do i control the overall volume of the whole movie?
Thanks
i
Controlling Volume Of Loaded Swf
I have a movie that is loading 2 external swf files using loadmovie and loading into empty mc's. I want to set the volume of one of them to 0 but keep the movie playing. Later in the movie, I want to bring the volume up to 100. I am lost and don't know where to start.
Thanks
FSCommand For Controlling Volume
Hello,
can anyone help me out with an FSCommand that will control volume for something else on the page than just the flash? Like a media player or the ehntire computer>
Thank you
Audio Volume Scripting
I'm hoping some of you flash audio and scripting guru's can help me out here. I'm wondering if it is possible to control the volume of a layer with an audio on it (looping indefinitely).
My project involves about 5 layers in a MC with each layer having an audio loop which all start simultaniously and loop indefinitely, I need to be able to control the volume (mute the sound) of a selected layer(or two) when the user clicks on a particular button, when they click the same button again the volumn is returned to full.
Trying to get an effect similar to a mixing program where if the user clicks for eg. the drum button the drum loop will continue but will be muted. when it is clicked again the volumn is back to full and all the loops on each layer are still in sync.
let me know if this needs further explaination.
thanks in advance.
Audio Volume Controller
Hi, I'm making an audio player and I need to have an audio controller so that a viewer can scroll the volume to as high or low as needed.
http://www.juicystudios.com/tanked.html has a good example.
Does anyone know how, or have any tutorials?? Thanks
Audio In Swf. How To Adjust Volume?
I have an audio player that works great. Problem is I now want to try and make a volume control.
How do I adjust the sound of audio being played in a swf loaded into an empty movie clip?
Code:
// Dummy movie clip to contain audio
_root.createEmptyMovieClip("audioContainer", 10);
_root.audioContainer.loadMovie(_root.audioTrack[_root.currentTrack]["swfPath"]);
How can I access what ever audio is being played in
Code:
_root.audioContainer
and control it's volume, mute it etc.
No Audio Volume In SWF2Video
I just downloaded the trial version of SWF2Video Pro. I'll be converitng a lot of flash files in the future and would love to buy this program...but.....
I can't export the audio from the flash file. In my settings, when I go to create AVI, the volume slider is turned all the way down and will not move.
Seems there is a no-brainer answer that i'm missing. The audio is set to record from the flash file, NOT from a separate wav. The audio Codec is set to PCM (my only choice).
Is this something to do with the source flash file? I tried to different files from two different sources and got the same results.
Help.
Altering Audio Volume Using AS3
Hey, okay, so I have this:
Code:
var req2:URLRequest = new URLRequest("LFE_impact_rumble_bass_low_long_constant_BLASTWAVEFX_26228.mp3");
var s2:Sound = new Sound(req2);
var channel2:SoundChannel = s2.play();
Now, I want to set the volume of channel2 or s2, either way, so that it play louder than its default. I can not edit the file externally for that will take to long to perfect... Please help!
Thanks.
Audio Volume In NetStrem FLV
Hi all! I've got an instance of a video on the stage, and I play that video via NetStream:
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
video1.attachVideo(ns);
So, is there a way to control the volume of that video?
I've tried this method:
Code:
this.createEmptyMovieClip("flv_sound", this.getNextHighestDepth());
flv_mc.attachAudio(ns);
var audio_sound:Sound = new Sound(flv_sound);
audio_sound.setVolume(0);
But it seems it doesn't work.
Any idea?
Controlling Volume On An Imported Clip
I've imported a .mov file into my flash document. What I'm trying to do is make a volume controller for the imported movie. I know how to control sounds that are imported on their own and I know that I can splice the video from its sound and do it that way, but is there an easier way? Please help!! I'm looking for a quick fix. I would hate to write a bunch of code when I don't have to.
|