How to calculate the second and minisecond for audio landmark

I'm doing a sound synchronization for the clip audio and video in Flash. I found a tutorial on the web, and it seems to work. However, I do not know how to calculate the second and the mini (deuxieme from mp3 file. The first frame has the following lines to set the duration for each animation:
Import class
Import net.quip.sound.SoundSync;

Stop the main timeline
Stop();

Create an instance of SoundSync
var ss:SoundSync = new SoundSync();

ss.addCuePoint ("IT", 20100);
ss.addCuePoint ("admin", 20000);
ss.addCuePoint ("maintenance", 19800);
ss.addCuePoint ("treatment", 16479);
ss.addCuePoint ("engineering", 14598);
as.addCuePoint ("logo_epa_npdes", 12356);
ss.addCuePoint ("construction", 8967);
ss.addCuePoint ("370 mg/j", 7896);
ss.addCuePoint ("mc_650, 000 ', 5439);
ss.addCuePoint ("130 mg/j", 3254);
ss.addCuePoint ("1938", 2439);
ss.addCuePoint ("vintage_mc", 0);

Use the instance of loading external MP3
ss.loadSound ("Scn04 - 05.mp3", true);

Create a listener object for the
cuePoint and onSoundComplete events
var listener: Object = new Object();
listener.cuePoint = function (): Void {}
Play();
}
listener.onSoundComplete = function (): Void {}
Play();
}
ss.addEventListener ("cuePoint", listener);
ss.addEventListener ("onSoundComplete", listener);

and the soundsync.as file as follows:
Import mx.events.EventDispatcher;
Import mx.utils.Delegate;
class net.quip.sound.SoundSync extends its {}
PROPERTIES
private var _cuePoints:Array;
private var _currentCuePoint:Number;
private var _interval:Number;
private var _intervalDuration:Number;
private var _secondOffset:Number;
Event dispatcher
public var dispatchEvent:Function;
public var addEventListener:Function;
private var removeEventListener:Function;
CONSTRUCTOR
public void SoundSync(target:MovieClip) {}
Super (target);
init();
}
METHODS
private function init (): Void {}
Initialize properties
_cuePoints = new Array();
_currentCuePoint = 0;
_intervalDuration = 200;
_secondOffset = 0;
Initialize the instance of the class as the valid event broadcaster
EventDispatcher.initialize (this);
}
Add Cue Point
public void addCuePoint(cuePointName:String,_cuePointTime:Number):Void {}
() _cuePoints.push
{
type: "cuePoint",.
name: cuePointName,.
time: cuePointTime,.
target: this
}
);
_cuePoints.sortOn ("time", Array.NUMERIC);
}
Get cue point
public void getCuePoint(nameOrTime:Object):Object {}
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (typeof (nameOrTime) == 'string') {}
If (_cuePoints [meter] .name == nameOrTime) {}
return _cuePoints [counter];
}
} Else if (typeof (nameOrTime) == 'number') {}
If (_cuePoints [meter] .time == nameOrTime) {}
return _cuePoints [counter];
}
}
counter ++;
}
Returns a null value.
}
Get the Index of the current Cue Point
private void getCurrentCuePointIndex(cuePoint:Object):Number {}
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (_cuePoints [meter] .name == cuePoint.name) {}
return the meter;
}
counter ++;
}
Returns a null value.
}
Get the next Cue Point index
private void getNextCuePointIndex(seconds:Number):Number {}
seconds (seconds) =? seconds: 0;
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (_cuePoints [meter] .time > = seconds * 1000) {}
return the meter;
}
counter ++;
}
Returns a null value.
}
Benchmark deleted
public void removeCuePoint(cuePoint:Object):Void {}
_cuePoints.splice (getCurrentCuePointIndex (cuePoint), 1);
}
Remove all Cue Points
public function removeAll_cuePoints (): Void {}
_cuePoints = new Array();
}
Beginning
public void start(secondOffset:Number,_loops:Number):Void {}
Super.Start (secondOffset, loops);
dispatchEvent ({type: "onStart", target: this});
Reset benchmark
_secondOffset = secondOffset;
_currentCuePoint = getNextCuePointIndex (secondOffset);
Poll for cue points
clearInterval (_interval);
_interval = setInterval (Delegate.create (this, pollCuePoints), _intervalDuration);
}
Load sound
public void loadSound(url:String,_isStreaming:Boolean):Void {}
super.loadSound (url, isStreaming);
clearInterval (_interval);
_interval = setInterval (Delegate.create (this, pollCuePoints), _intervalDuration);
}
Stop
public void stop(linkageID:String):Void {}
If {(linkageID)
Super.Stop (linkageID);
} else {}
Super.Stop ();
}
dispatchEvent ({type: "onStop", target: this});
Kill the ballot
clearInterval (_interval);
}
Survey benchmarks
private function pollCuePoints (): Void {}
If the current position is close to the cue point.
var time: Number = _cuePoints [_currentCuePoint] .time;
var span: Number = (_cuePoints [_currentCuePoint + 1] .time)? _cuePoints [_currentCuePoint + 1] .time: time + _intervalDuration * 2;
If (position > = time & & position < = span) {}
Send event
dispatchEvent (_cuePoints [_currentCuePoint]);
Advance to the next landmark...
If (_currentCuePoint < _cuePoints.length) {}
_currentCuePoint ++;
} else {}
_currentCuePoint = getNextCuePointIndex (_secondOffset);
}
}
}
EVENT HANDLERS
onSoundComplete
public function onSoundComplete (): Void {}
Kill the ballot
clearInterval (_interval);
Reset benchmark
_currentCuePoint = 0;
Send event
dispatchEvent ({type: "onSoundComplete", target: this});
}
}

any help will be greatly appreciated.

Wuzhishan,

> Hi Dave, your tutorial is very cute and it is very useful.

Thank you! My daughter is cute. She inherited all of
me, so I have not left. ;)

> I'm sorry that I don't have my question clearly.

No worries. :)

> I have listen mp3 in Windows Media Player and try to
> get both for the tail, I found it on the bottom of the
> player time indicates 00:26.

I'm with you.

> How can I writer this number in the code? Is it 0026 or 26?

The code expects milliseconds, then 26 seconds would be written as
this:

26000

If he said 01:22 (one minute and 22 seconds), you must write it like this:

82000

... which is 60 seconds for now, 22 seconds
side, then multiplied by 1,000 to get milliseconds.

David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

Tags: Adobe Animate

Similar Questions

  • How to adjust the brightness and contrast for Compaq Presario all-in-One CQ1-1007 D desktop PC

    How to adjust the brightness and contrast for Compaq Presario all-in-One CQ1 - 1007 D desktop PC? THX.

    There were buttons No. brightness and contrast on the front of the monitor-no onscreen menu.

    On your desktop,.
    Right-click to select graphic properties->

    in display settings, click Advanced settings
    Here you go, you can do almost anything with the brightness

    Hope it helps

  • How to get the second and third weekend of every month over a period of time?

    Hello

    No idea how to get the second and third weekend of every month on a given period without use of CLAUSE?

    Thanks in advance.

    Try it below,

    SELECT CASE WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 1

    WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 6

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 1

    END as second_weekendday,

    BOX WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7

    WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 7

    END AS third_weekendday

    FROM (SELECT SYSDATE startdate,

    SYSDATE + 300 enddate

    THE DOUBLE)

    CONNECT BY LEVEL<=>

  • How to calculate the number of Out_flags for the PIPL?

    Hey everybody!

    I'm kinda new to After Effects of programming, so I hope I'm not asking an obvious question.

    I searched the web and this forum but just could not find a solution to this problem.

    Compilation of my plugin works fine, but as soon as I select it from the menu effects I am presented with an incompatibility error.

    My question (already in the title): how to calculate the correct number for the global_out_flags pipl?

    Thanks in advance,

    Markus

    If you want the easiest option, just start with the debugger and to break in the General preferences where is defined, or, if you find amusement in the bit and other Boolean arithmetic shift, please do not hesitate to look at the macro

  • How to find the Maxima and Minima for each column of a 2D array?

    Hello

    I have a 2D chart and I would find the maxima and minima of each column of the 2-D table. Even though I know how to get maxima and minima for the whole picture but don't know how columnwise? Any ideas please?

    Thank you

    Rohit

    Hello

    @Smercurio-What you said is true, I should have shown using automatic indexing enabled which is really excellent choice. I just tried to show in a very simple way.

    Anyway, here's the best way

  • How to set the brightness and contrast for HP Omni 120-1125.

    You will have to troubleshoot my mother-in-law who has a HP Omni 120-1125.  Impossible to find info in the online books

    I don't know any button to change the display settings on this computer. However, I think I can help you find the equipment and audio in the control panel. I hope that all you need to do is change the setting "display by. I suspect that right now, it's on one of the icon views.

    Open the control panel and in the upper right, click the drop-down list next to "view in:

    Select "category".

    You should now see a list of categories, including equipment and audio.

    And now, I hope that the steps that I posted before will work for you. Please let me know if you encounter any problems.

  • HOW TO SET THE TIME AND DATE FOR MALAGA SPAIN 29130

    TIME AND DATE FOR MALAGA SPAIN

    Hi Colin,

    Thanks for posting your query in Microsoft Community.

    • Are you referring to a zip code when you say 29130?

    I would refer to the procedure described in the article below to set the date and time in Windows 7.

    Change the display of dates, times, currencies, and measures

    You can also view: set the clock

    Hope this information is useful. Please feel free to answer in the case where you are facing in the future other problems with Windows.

  • How to: Apply the second and third output referenced Formulation

    Our use case is-

    There are several ways to squeeze oranges in orange juice of matter with levels of by-products.  We have a 'main' formulation that produces a material output referneced of Orange juice.  We want to now relate to additional formulations.  How this is done?

    Now our business has been... create formulation 500001-001 with output material 5000002-001

    We have also created formulations 500003-001 and 500004-001

    When you go to the material specification > > partners fact sheet > > produced by... Open in Edit Mode

    We are not dealing with an Add button to connect the formulation 500003-001 and 500004-001

    If there is another way to do it, I didn't understand it although people have tried to explain it to me.  Could I get an idea of the stream click to get results... referenced material output with several options.

    Thank you.  Beckie

    Thanks Sherry,

    I was trying to understand the course of "add material specifications 500002 - 001 as a material output of formulation" 500003-001... It does appear to me that I could change something exit we created.  After several hours of looking at this, I found the 14 steps to the product developer.  Thank you.

  • How to display the date and time for the date fields in SQL Workshop

    The workshop of the Apex SQL always truncates the time of date fields. Is it possible to change the default displayed date format / time fields?

    I would not advise to make direct updates to the table wwv_flows or any other object of the apex.

    Change here Home > Application Builder > Application XXX > shared components > change attributes if necessary globalization.

    See you soon

    Ben
    http://www.munkyben.WordPress.com
    Don't forget to mark the answers useful or correct ;)

  • How to calculate the size of index?

    How to calculate the size of indexes for a small relational database. Please make it clear that I understand.

    Hello

    How to measure size.

    View DBA_SEGMENTS gives the size of all the Segments (Table, Index,...).

    If you can for example use a query like this:

    select segment_name, bytes "Size in Bytes"
    from dba_segments
    where owner = ''
    and segment_name = ''
    and segment_type = 'INDEX'
    

    Hope this helps.
    Best regards
    Jean Valentine

  • How can I force DAC to run always full load for one of the task that executes the stored procedure? And remaining tasks load incremental in the second and sub sequent executions.

    Hello

    How can I force DAC to run always full load for one of the task that executes the stored procedure? And remaining tasks load incremental in the second and sub sequent executions.

    Thank you

    Jay.

    Hi if your task is running an informatica mapping you can set your DAC task to run the full mapping for incremental and full loads, so tab task just point to the mapping.

    Hope that helps.

    Thank you

  • How to calculate the length of the video format (seconds)

    Hello

    I use the ActionScript 3.0 CookBook book and it shows how to calculate the length of a video (and also playing the video in progress) in seconds using the property at the time of the NetStream class.

    So, for example, the length of my video is 1070 seconds.

    But I want to be able to convert a format such as ' 00 (hours): 00 (mins): 00 (dry) ", '1070 seconds' how can I get this?

    Any help is appreciated!

    TA :)

    Kind regards
    M.

    Hi, thanks for the reply :) you have helped me understand the following code which I just found (and that seemed to work the way I needed it).

    Quote:

    If (_duration > 0 & _stream.time > 0)
    {
    _playbackTime.text = generateTime (_stream.time);
    }

    function generateTime(nCurrentTime:Number):String
    {
    var nMinutes:String = (Math.floor(nCurrentTime / 60)< 10="" "0"="" :="" "")="" +="" math.floor(ncurrenttime="">
    var nSeconds:String = (Math.floor (nCurrentTime % 60)< 10="" "0"="" :="" "")="" +="" math.floor(ncurrenttime="" %="">

    Result set
    var sResult:String = nMinutes + ":" + nSecondes;

    Return value
    return sResultat;
    }

  • How to monitor the TX and RX on PERFORMANCE for virtual network adapter BASP monitor?

    How to monitor the TX and RX on PERFORMANCE for virtual network adapter BASP monitor?

    I have a virtual network adapter that is created with Broadcom.

    This virtual interface named "BASP eCard" visible on the performance monitor in the category 'Rhythm Pipe' but not in the category "Network Interface".

    This is problematic because the Tx and Rx (bytes received/send in second) is available in "Network Interface" that show physical network cards only.

    Someone has an idea?

    Thank you

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    I recently had to format my hard drive and reinstall iTunes 12.3.2.35 on my Win7 PC. As part of the re - install iTunes, I clicked on the button scan for music.  This has created duplicates several of my songs.  I deleted then the duplicate songs from iTunes, but when I went to play a few songs a pop-up said "the song would not be because the original could not be found.  You want to locate? "When I tried to locate the song it is not found, but when I pulled the songs out of the trash they could be found.

    How can I keep the original and remove any duplicate songs in iTunes on PC Win7 which took place after iTunes to scan for music during a re - install?

    iTunes can create duplicates if the same content is added several times from outside the media folder when it is about to make copies of everything that is added to the library, or is added from an external drive that hosts the press kit that was disconnected during the launch of iTunes.

    Official notice of Apple on the duplicates is here: find and remove duplicates in your iTunes library. This is a manual process and article fails to explain some of the potential pitfalls such as the lost coast and membership of playlist, or sometimes the same file can be represented by multiple entries in the library as well as a removal and recycling the file will break all the others.

    Use MAJ > display > show items to reproduce exactly to display the duplicates because it is normally a selection more useful. You must manually select all but one of each group to remove. Sort the list by Date added can make easier select appropriate tracks, but it works better when executed immediately after the dupes were created.  If you have several entries in iTunes connected to a same file on the disk hard then don't not send to trash.

    Use my DeDuper script (Windows only) If you are not sure, do not want to do it by hand, or want to maintain ratings, play counts and playlist membership. See this background thread , this post for detailed instructions and Please take note of the warning to back up your library before deduping.

    (If you don't see the menu bar press ALT to temporarily view or CTRL + B to keep displayed.)

    The latest version of the script can put away the dead links as long as there is at least a double live to merge his stats and membership of the playlist and must deal wisely when the same file has been added through multiple paths.

    TT2

  • Hi I have just signed up for the Apple's music and I forgot to cancel my game from itunes (it is no longer needed) who crossed just automatically - how to cancel the game and can get a refund?

    Hi I have just signed up for the Apple's music and I forgot to cancel my game from itunes (it is no longer needed) who crossed just automatically - how to cancel the game and can get a refund?

    To stop renewing, login to your account (for example by tapping your id settings > iTunes & App Store on your iPad, or by clicking on your name / icon to the top right of the iTunes on iTunes on your computer screen), and go to the iTunes in the cloud Section - see to halfway down this page: subscribe to iTunes game - Apple Support

    In terms of refund, try to contact iTunes Support and see if this will change (purchases are considered final), either via http://reportaproblem.apple.com or http://www.apple.com/support/itunes/contact/

Maybe you are looking for

  • Satellite L30: Join to the domain takes 10 min

    We bought a Tosh Satellite L30 and it came with Vista Basic pre-loaded. On our domain, we use software only supported up to Windows XP Pro, Windows XP Pro SP2 has been installed (formatted HARD drive)I downloaded XP drivers, (I see there is no chipse

  • Access the laptop on a computer Toshiba Satellite A300 recovery Partition

    What main features press on to have Toshiba Satellite A300 to start the recovery partition?On a Gateway PC you need to press and hold Alt + F10, and then press Esc and Alt + F10 to access the recovery information on the hard drive without the CDI do

  • Im trying to use my dazzle with the new windows 7

    Im trying to use my dazzle recorder dvd with the new windows 7, but its does not work I did all the things he told me to do, but im not getting video or sound now

  • ADDITION TO THE SEARCH REPORT PAGE NUMBERS

    I read the posts on the insertion of the page numbers with Vista on Word.  I need to be white, but the next three pages to have Roman numerals, the title page. The text of the book will be numbered beginning with 1. Please help, the format of this do

  • WiFi doesn't connect while the phone is in standby

    Everyone knows the mobile data taking priority over wifi in some compact Z5 scenarios? To reproduce: Phone is fully charged.  None of the energy savings options are enabled.  Dungeon of wifi on during sleep is enabled. Phone is somewhere far away fro