Flash :: Differences Between Sound.length And SoundChannel.position In ActionScript 3?

Jan 20, 2010

I load a song and when I get the length the song never reach this value.Here is issue document by another guy AS3 - SoundChannel.position never reaches Sound.length.And here is my code

import flash.display.Sprite;
import flash.net.URLRequest;
import flash.media.Sound;[code]....

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Soundchannel.position Working, But When Resumed, The Sound Rewinds A Little?

May 28, 2008

I have a pause button that pauses a sound playing in a soundchannel. It works, but when I resume the sound, it isn't in thecorrect position, almost like it was rewinded a little. I'm usingthe code straight from the

View 1 Replies

ActionScript 3.0 :: Save The SoundChannel.position Number (and Also Call SoundChannel.stop()) In Correct Time

Dec 6, 2008

I just finished a simple music player... For testing purposes. I upload it in the following address:http:[url]....with 10 music songs that I had recorded from radio stations(added the last 2 twice for testing).The problem is that when a song has totally loaded, stop action taken needs about 1 second to be applied!I.e. When I press "STOP", the sound continue to play for 1 sec before stop. When I push "pause" it takes one second for the music to stop!

However when using resume (second time pause) the sound starts instantly! Thus I guess there is an issue with stop()function of the SoundChannel object that I am using to stop the sound. Also notice that when unpause the music, it continue ~one second before the last sound - which means that I saved the soundChannel.position number (and also call soundChannel.stop()) in correct time, but it didn't stop immediately - bug!?

This only happens when the application runs through a browser(plugin v. 10) - programmed in CS3.

PS1. Notice that ,this also happens when I change Volume too. Thus because Stop and Volume are parts of SoundChannel, I guess there might be a bug with SoundChannel in online plugins..... :/

PS2. Notice that ,this also happens when I close the browser (firefox). Even if browser is closed the music continue for 1 sec the same way as when pressing stop!.. Thus I guess it's flash bug!...

View 2 Replies

ActionScript 2.0 :: [MX] Mp3 Sound Position / Sound Length?

Apr 28, 2003

I am trying to get mp3 sound position and sound length to work. Heres the code below and I ahve attached the FLA.

Code:
// Create a new Sound object.
var music = new Sound();
// Create a text field to show sound length.

[Code]....

I have attached my FLA file. You will need to through a MP3 in the same dir as swf file names test.mp3..

View 1 Replies

Flash :: Sound Length In Actionscript - Get 0 Instead Of The Length In Milliseconds Of The Sound?

Aug 13, 2011

I am trying to use the class Sound of actionscript.My code is really basic :

var snd:Sound = new Sound();
snd.load(new URLRequest("mysound.mp3"));
trace( new String(snd.length));
snd.play();

The audio is playing very well but in my trace, I get 0 instead of the length in milliseconds of the Sound.

View 1 Replies

ActionScript 3.0 :: Sound Position And Length On Slider Component?

Sep 11, 2011

I have the following working great:
 
stop_btn.setStyle("icon", square_mc);player_btn.setStyle("icon", next_mc);
import flash.events.Eventimport flash.events.MouseEvent;import flash.media.SoundTransform;
var alreadyDefined:Boolean;volumen.value = 1;

[Code].....
 
I have another slider component on the movie with instance name PROGRESO

I would like for PROGRESOnto indicate (update) the sounds progress as it plays and be able to scrub through the sound.

View 7 Replies

AS3 :: Flash - SoundChannel, RemoveEventHandler - Use The Sound Channel?

Apr 5, 2010

Is there a better way to use the sound channel is AS3?

var mySound:Sound = new Sound();
playButton.addEventListener (MouseEvent.CLICK, myPlayButtonHandler);
var myChannel:SoundChannel = new SoundChannel();
function myPlayButtonHandler (e:MouseEvent):void {

[code]....

View 2 Replies

Actionscript 3 :: Save Sound From SoundChannel Object Flash

May 3, 2011

I'm planning to program a small piano in flash that have an x number of notes to play through a SoundChannel.

What I have not found is a way to record what is playing through SoundChannel and send it as byteArray to a server side script that will save it as WAV (or mp3).

I know Flash Player 10.1 allows you to record sound, but everything I have found is about recording sound using the microphone class. It seems the way to go is to send the sound data to the microphone. That doesn't seem very right or possible though..

View 2 Replies

Flex :: Overcome Flash Player SoundChannel Or Sound Limit?

Oct 23, 2010

From the Flash player specification, it supported up to 15/16 or 32 sounds in a buffer, which mean any more sounds is load beyond that limit will either caused buffer stop working.

Is there any class to override to increase sounds to 1024 or greater?

View 1 Replies

ActionScript 3.0 :: Assign A Sound To A Soundchannel Without Playing The Sound?

May 4, 2011

The thing I don't understand is how to assign a sound to a soundchannel without playing the sound. All the examples I've seen do this.

Code:
_SoundChannel = _sound.play();
_SoundChannel.stop();

And how can I set a SoundChannel volume to zero before allocating a sound to it?

View 2 Replies

Actionscript 3 :: SoundChannel.position Inaccurate?

Jun 8, 2011

EDIT: Sorry for the question being reworded, but I am just simplifying the issue. I am not getting accurate values for SoundChannel. position for an external MP3 that is playing.I've tried a variety of audio bitrates and consistently,i am getting a SoundChannel.position that is less (~250 ms) then where the actual audio has played to. As well, the position never equals the duration. It always finishes behind, even when the SOUND_COMPLETE event is generated.

Adobe says any Sound position/duration issues are fixed with the latest Flash Player. I am obviously not getting the same results. I need very accurate position values in order to have a custom draggable timeline and cue points.

View 1 Replies

ActionScript 3.0 :: Sound Name From SoundChannel

Apr 17, 2009

I wondered if there is a way to find out from the soundChannel the url of the sound it is currently playing. once I found out its url, i can than use its name to call something else.Or anyway to find out the sound that is playing on a soundChannel.I will know which channel to look into, but different sound will be loaded into this soundChannel.If this is not possible, i thinking along the line of overloading SoundChannel play method so that is fires an event when the sondchannel plays and also find out the name of the sound file it is currently playing.

View 2 Replies

ActionScript 3.0 :: Sound Object Or SoundChannel For Various Sounds?

Apr 10, 2010

As I have commented before I am building English teaching apps. I will have music playing in the background, words being pronounced and at times a surprise sentence. All three could sound at the same time at any given point. To build this properly should I use SoundChannel for all of these? 
 
At the moment my code for the music loop is as so. The sound is in the library and exported for AS. Is this code fine or is it better to assign it to the SoundChannel class.

View 1 Replies

ActionScript 3.0 :: Play An Instance Of A Sound In A Soundchannel

May 3, 2011

I have some sounds in my library that I want to play in a soundchannel, but how? This is what I have so far:

var music:Sound = new Sound();var channel:SoundChannel = new SoundChannel();var sTransform:SoundTransform = new SoundTransform();var sound:SoundFile1 = new SoundFile1();  // Note: SoundFile1 is a class; in it is my soundfile in the library// music.load(sound); ??channel = music.play();

View 1 Replies

ActionScript 3.0 :: Sound.play() Always Creates A New SoundChannel?

Nov 23, 2009

I've just started working with sound and as I understand it I primarily need two objects: Sound and SoundChannel. Every call to a Sound.play() method will create a new SoundChannel object. So technically, I could write my code like this:

Code:
package
{
import flash.media.Sound;

[code]....

Will simply create a new SoundChannel object and the first one created by the constructor will be garbage collected? As a side note, it's possible to see Adobe's source files e.g.SoundChannel.as. I'm curious as to how the SoundChannel.stop() method works since it doesn't throw an error or exception even if the audio has already stopped playing.

View 3 Replies

ActionScript 3.0 :: Check Sound Already Playing In A Soundchannel?

Aug 9, 2011

How do we check if there is a sound already playing in a soundchannel?

View 1 Replies

ActionScript 3.0 :: Trigger An Event When Any Sound In A Soundchannel Completes?

May 3, 2011

I have a soundchannel, and I'm playing a lot of sounds in it, but I need the completion of any sound file within that channel to be followed by a wait of two seconds, then trigger an event. How can I do this?

View 4 Replies

Flash :: Retrieve Valid Sound.length Property Before Streaming Loading Is Done?

Oct 13, 2011

I would like to know what bitrate is song, so I count it this way:

var bitrate = Math.floor( 8*_snd.bytesTotal/_snd.length);

but unfortunately I can not retrieve valid value for _snd.length before all the song is loaded. Is there any other way to achieve that value?

View 2 Replies

ActionScript 3.0 :: Determining Sound.length?

Mar 13, 2009

normally the sound.length property is only accessibleafter the sound has finished downloading.I have heard there is an algorithm that can determine thesound.length property before an mp3 has finished downloading, or atleast approximate it very closely

View 1 Replies

ActionScript 3.0 :: Show Sound Wave Length Within MP3

Jan 28, 2009

I know AS3 can create visualizations using sound waves, But I'm trying to find something that will show the wave length within a mp3. So as it's playing, you'll see when the audio is spiking or dipping.

View 4 Replies

ActionScript 3.0 :: Get The Length Of A Sound Before The File It's Loaded

Sep 20, 2010

Code from the character package (einstein.as):

Code:
//load sound
public function talk(url:String):void
{

[Code]....

Problem is, soundFactory.length will return 0 ! That's because .length needs the entire file to be loaded in order to return the proper value, right ? If i trace it in "completeHandler" function, the right value is being shown but i cannot return the value to use it as a parameter in the "asteapta" function, at least i have no idea how. I guess i need to know the sound length before the file is being loaded.

View 5 Replies

ActionScript 3.0 :: Incorrect Sound Length Property Value?

Jul 29, 2009

I have a Flash based media player loading mp3s at 22.050 khz, and for some reason the length is being reported as a little over twice what it should be. Is there anything I can do, short of dividing the results by 2?

View 4 Replies

ActionScript 2.0 :: Uses Sound.position And Sound.duration To Use As A Playlist?

Jun 19, 2006

I have currently a music player that uses Sound.position and Sound.duration to use as a playlist. However, the sound is streaming, so then Sound.duration is the number of loaded seconds/miliseconds. Is there a way for me to figure out the duration of a sound without fully loading it? Right now, it really messes up the playhead.

View 2 Replies

ActionScript 3.0 :: Get Sound Length Before The Mp3 File Is Downloaded Completely?

Nov 6, 2009

is it possible to get Sound length before the mp3 file is downloaded completely?

View 7 Replies

ActionScript 3.0 :: Length Of Sound Recorded In Bytearray In Seconds

Jan 30, 2012

I'm trying to build a play back progress bar for an audio recorded from the users microphone. It works okay but when I play back I can't figure out how long the audio is so I can calculate percent played for animating a progress bar. Most of these snippets can be found in LiveDocs and online examples from bytearray.org. Audio is stored in the bytearray and the sound is played back in a sound channel.

[Code]...

View 2 Replies

ActionScript 3.0 :: Get Sound Length Before Mp3 File Is Downloaded Completely?

Nov 6, 2009

Is it possible to get Sound length before the mp3 file is downloaded completely?

View 1 Replies

Actionscript :: Manipulate The Position Of Multiple Sound Objects Client-side In Flash?

Jan 20, 2011

If you wanted to create a client-side Flash-based sound editor that lets you load more than 1 sound to an interface that allows you to manipulate the individual positions of the sounds, and mix/play them in real time, how would you accomplish this?

I'm looking to create a simple version that can mix 2 mp3s, allowing the user to adjust the positions of each. Sort of a dumbed down version of Aviary's Myna audio editor.

At the end of the mixing, I would also like our server to mix the 2 mp3 files with the proper positioning into 1 mp3 file...

View 1 Replies

Flash - Differences Between 2.0 And 3.0?

Aug 13, 2010

I'm developing a simple Flash animation using Flash Professional CS5 and I'm writing some ActionScript code. I noticed there's a choice between using different versions of ActionScript.Wondering what the key differences are between 2.0 and 3.0...?

View 4 Replies

Differences Between Flash And AIR?

Sep 19, 2010

From a developer's point of view, are there other differences between Flash and AIR to take into account, apart from the certificate and AIR not supporting ActionScript 2.0?

View 2 Replies

Differences Between Flash Player 6 And 7+

Dec 29, 2009

I used Jamie Durrant's tutorial for making a chat bot in flash. Everything works fine, but one thing which makes the bot remember people works only if the fla file is published in Flash Player 6 version. There are 4 symbols: a button, user, reply and custid: user is the textbox where the user inbuts the text, reply is the textbox that displays the bot's reply and custid displays the id of each person. If the version is newer than flash player 6 it says "undefined". It's a local shared object, I think. Could this code be edited to work in later versions or I have to stick with flash player 6 (the graphics are worse even at lossless compression)[code]

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved