Pause / Play audio

Any ideas on how I can pause my .swf audio (using a "Pause"
button, then hit a "play" button to either resume the audio where
it stopped or at least restart that same audio segment?
At present, if the scene is "paused" and then the viewer hits
"play", the scene resumes at the stop-point, but the audio segment
that was interrupted is silent.
Thanks for any insight you can offer!

The Sound class is the only thing you really need. Classes
define
objects in Flash, and generally describe one or more of the
following three
categories: properties (characteristics), methods (things the
object can
do), and events (things the object can react to).
Look up the "Sound class" entry in the ActionScript 2.0
Language
Reference and you'll have a complete "Owner's Manual" of
programmed sound in
Flash.
Nothing wrong with one of the Media components, by the way.
Given this
project is a CBT module, it may actually come in handy. For
this, look up
"Media class" in the Components Language Reference. The
Components docs
aren't organized nearly as neatly as the ActionScript docs,
but you still
get a list of properties, methods, and events. Components do
tend to weigh
a bit, though, and may be more than you need.
If you just want to start, pause, and resume sound, check
out the
hyperlink in my earlier reply. :)
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."
"scrinmemphis" <[email protected]> wrote in
message
news:ev360l$kuu$[email protected]..
> OK...
>
> I'll show my naivity here.
>
> "attaching the audio to a media component."? What does
that mean. Sorry.
> I'm fairly new to Flash... ;-)
>
> Thanks!

Similar Messages

  • Simple Pause/Play/Resume in timeline not audio

    So sorry if this is simple. I HOPE it is simple, it should be simple.
    I have a very simple looping timeline. I just want to create a TOGGLE function so that the user can pause and resume. Like a freeze frame. Or the space bar in some movie editing programs. Simple PAUSE.
    http://colorisrelative.com/RichMedia/templateROTATING.swf
    Everything I find for pause is a pause for a defined duration-- then it resarts on its own.
    I want to pause on the current frame and restart on the current frame when the user clicks.
    (or I keep finding stuff for video and audio). I am hoping there is real simple solution. I am really bad at actionscript. The following is the exent of my knowledge of actionscript:
    (click to start)
    http://colorisrelative.com/RichMedia/template3as2moosh.swf
    So thank you for letting me know if there is a simple pause/play toggle function!!!

    Thanks for showing the code you understand.  For what I'll offer, the approach is to use a variable that keeps track of what state the movie is in (paused or playing) and use that variable to decide how to make it the opposite of what it currently indicates.
    On the timeline create a variable:  var pausePlay = false; // this is if the movie starts plyaying right away without clicking anything
    Create a button that covers the whole stage like you did for the second exmple.  Add this code to the button:
    on(release){
         if(pausePlay){
              play();
              pausePlay = false;
         } else {
              stop();
              pausePlay = true;

  • BUG: repeated pause/play causes malformed audio name track name

    itunes9:
    I was listening to a language audio track. Therefore I was pausing and playing it repeatedly while I said out loud what they said on the track. I found the track listing and the now playing area started changing ever time I did this pause/play sequence.
    The track called "12 12-Topic 11", started having a new 12 prepended to it, i.e.
    "12 12-Topic 11"
    "12 12 12-Topic 11"
    "12 12 12 12-Topic 11"
    etc

    I recently encountered exactly this bug *while importing WAV files I had created from a vinyl record* (using Final Vinyl).
    Having dragged the files into iTunes from a Finder folder, I then went through each 'Get Info' menu to insert the track number (ie: 'N of M'). The spurious numbers then started appearing in front of the track name in the Title field spontaneously as I moved from one track to another.
    There did not seem to be any pattern - some number appeared as soon as I had closed the 'Get Info' menu and moved on to other tracks; other appeared later; some never did - ie the track names were left alone.
    I deleted the numbers from the track names manually, in the iTunes list display, and the problem seems to have gone away - but I'm not sure - I will reload that iTune library (from our family NAS) tonight, and check again.
    I had never seen this problem before I upgraded to iTune 9 - despite having followed this process before in iTunes 7/8.
    Incidentally, in answer to one of the comments above about Gracenotes; I have frequently imported WAV files from CDs, previously recorded from vinyl on an old Windows laptop (with no track names), and Gracenotes has correctly supplied the album and track names - presumably from the number and durations of the tracks in the album. In the case of this live album, I started with 4x20min WAV files - each one, a whole side of a vinyl record - before chopping it up into 23 tracks using Final Vinyl. When these were initially imported into iTunes, Gracenotes incorrectly identified it as some old YES prog-rock album I'd never heard of!

  • IPhone 4S keeps playing audio from a video file that is no longer on my phone.

    If I'm listening to music and try to change tracks or pause with the earbud buttons the music fades out and starts playing audio from a video file. It will only play about 3-4 seconds and then stop. This also will happen when double clicking the home button to try and change tracks. When I do that the track skipping buttons won't work and there's no title for the short bit of audio that plays. The only way to get music to start playing again is to go into music and press play again. The music I had been listening to is sitting there paused. The audio from the mystery video file still sometimes plays even when you're in music and the only way you would know is the little play icon at the top right part of the screen. I have removed every video off of my phone and it still does it. This is really frustrating.

    Sounds like a bad battery.  You'll need to bring the phone into Apple for evaluation.
    I'm sure you've been using your phone as designed and properly backing up your data, so you should have minimal, if any data loss should the phone need to be replaced.

  • ITunes 10.4 removed spacebar pause for audio playback. WHY??

    Before iTunes 10.4 I could just tap the spacebar to pause and play audio, now when I tap it it jumps backwards one track. You can see that the Back button is highlighted.
    Is there a workaround for this?

    I just ran my MacBook flat whilst still running a few programs including iTunes. When I restarted (I can't use 'resume' as I run Bootpicker) iTunes had gone back to normal function of the spacebar when in mini player mode.
    But now the spacebar is opperating the 'switch-view' (I'm not sure what it's actually called) button as you can see there is a blue highlight surrounding it.
    How can I stop iTunes from changing which buttons are highlighted!?

  • Play audio files in Bridge CS6

    Hi,
    I used to be able to play audio files created with my Mk4 right in the preview window in CS4 which was easy for renaming files after their description was recorded when taking the shot.
    Does anyone know how I can do this in CS 6 - there are no play/pause controls under the preview like there was in CS4.
    Thanks Heaps for any help.

    Hi ,
    yes , MK4 and .wav files
    I have Mac 10.7.5 & Bridge CS6
    I have selected "Play audio files automaticly when selected" in the preferences but it doesnt do it.
    In previous versions of bridge you could get a play and pause buttons below the .wav icon view in the preview
    but this doesnt happen.
    It is really inconveinent as it defeats the purpose of having the .wav file and the I have to go back to Bridge CS4 to play the files.
    Thanks

  • Load and Play audio file (either sound or music) from my computer using DirectSound in C++

    #include "stdafx.h"
    #include <dsound.h>
    class AudioPlayer
    private:
    unsigned long long start_point,
    playback_point,
    break_point;
    bool now_playing, loop, ignore_start_point;
    int speed;
    //and any data that stores an audio (can be either sound or music)
    public:
    void Play_or_Resume(); //Either starts playing or resumes the audio stored in private (Runs a thread that either increments or decrements the playback_point by the speed member and sets the now_playing member to true).
    void Pause(); //Stops playing the audio stored in private until Play_or_Resume method is called (Just suspends the thread that was mentioned above and sets the now_playing member to false).
    void Play(unsigned long long from = 0, unsigned long long length = -1, bool move_start_point_too = true);
    //Plays audio from the value of the 'from' parameter along the value of the 'length' parameter and sets the now_playing member to true.
    //Playback point is pushed to the value of the 'from' parameter, and break point is pushed to the result of from + length.
    //If move_start_point_too parameter is true, then also start point is pushed where playback point is pushed too (to the value of the 'from' parameter).
    //Also the value of the 'from' parameter is an absolute position, but otherwise (if move_start_point_too parameter is false) it ('from' parameter) is relative to start point's position until it (start point) is ignored.
    //The value of the 'from' parameter never can be negative!
    void MovePlaybackPoint(unsigned long long new_position); //Modifies playback point position that is stored in private to a new position that indicates to sample no. new_position.
    unsigned long long GetPlaybackPointPosition(); //Returns playback point's position that has been alreadyS mentiond above.
    unsigned long long GetLength(); //Returns total number of samples in the audio stored in private.
    void MoveBreakPointTo(unsigned long long new_position); //Moves the break point to a new position that indicates to sample no. new position.
    //If the loop member is false, then audio should always stops playing and also set the now_playing member to false, when playback point reaches the break point, even the Pause method was not called.
    //Then calling again the Play_or_Resume method will bring the playback point back to start point (the default value for this member is zero 0).
    //But if the loop member is true, then playback point just returns to start point immediately and continue playing from there (now_playing remains true and it's value is unchanged).
    //There is a possibility to move the break point to a negative integer, so audio either stops and sets now_playing to false or replays from start point and left now_playing true according to the loop member, at the end of the audio. The default value of break point member is minus one -1 .
    unsigned long long GetBreakpointPosition(); //Returns the position of the break point that has been already mentioned above.
    void MoveStartPointTo(unsigned long long new_position); //Moves the start point to a new position that indicates to sample no. new position.
    unsigned long long GetStartPointPosition(); //Returns the position of the start point that has been already mentioned above.
    void EnableRepeatMode(); //Sets the private loop member to true.
    void DisableRepeatMode(); //Sets the private loop member to false.
    void ToggleRepeatMode(); //If loop was true before calling this function, so after it is false. Otherwrise it is true.
    bool IsRepeating(); //Returns whether audio repeats itself (from start point to either breakpoint or end of buffer). This function just returns the value of the loop member.
    void SetSpeed(int num_sam_per_sec); //Modifies the number of samples that are played in every second.
    //If number (integer) is negative, then audio is played in backward.
    //When playback point reaches start point, then it is transferred to break point if it's position is not negative. Otherwise it is transferred to the end of the audio buffer.
    void IgnoreStartPoint(); //Sets the ignore_start_point member to true. Then all methods always relate to start point as zero (even if it's value is not zero).
    void ReferStartPoint(); //Sets the ignore_start_point member to false.
    bool IsStartPointIgnored(); //Returns whether start point is ignored or not. This method just returns the value of ignore_start_point member.
    int GetSpeed(); //Returns the number of samples that are played in every second.
    void SetNumberOfChannels(byte new_value); //Modifies number of channels.
    byte GetNumberOfChannels(); //Returns number of channels.
    void SetBlockAlign(byte new_value); //Sets block align.
    byte GetBlockAlign(); //Returns block align.
    const char* LoadAudioFromComputer(const char* path_and_name_of_file, AudioPlayer* lpAp, bool auto_start_playing = true);
    //This function fills the instance pointed by 'lpAp' parameter with the data of the audio file redirected by 'path_and_name_of_file' parameter, and calls the Play_or_Resume method of this instance if auto_start_playing is true.
    //If the function succeeds, then it returns "succeed". Otherwise (if the function fails) then it returns an error string that describes the problem (the reason it failed). It can be sent to output, so it can be read, by either call to MessageBox, printf, std::cout, TextOut, DrawText functions and etc.
    //The function can fails, because the file was not exist, or could not be opened for reading, because it was opened by another process, or the file was either encrypted or protected, or corrupted, or was not audio file, but text, image and etc.
    I want to implement all methods of the AudioPlayer class and the LoadAudioFromComputer function by myself using DirectSound (the <dsound.h>) and all functions, interfaces, methods, structures, etc... that this header provides, but I don't know how! I
    need your help! This is difficult for me to find in the internet the information I need to do this. MSDN is teaching all this stuff, but this is too difficult! I need you to implement all these methods of the AudioPlayer class and the LoadAudioFromComputer
    function for me using DirectSound and the <dsound.h> and the explanations I wrote in comments, and then post the code. I will copy it to mine and read it all to learn. Please use comments so I can understand. I will thank and appreciate anyone who will
    donate his time to help me and do this for me! :D

    Microsoft pulled the plug on DirectSound HAL in Vista due to lack of hardware support. The SAL exists for
    software compatibility, good intention but bad performance as there is no longer a direct path from
    DirectSound to audio drivers.
    People choose DirectSound for its Direct-ness
    but there is no reason to choose it now.
    DirectX SDK was integrated
    with WIndows SDK which ships with Visual Studio 2012 so you don't need additional downloads for
    WASAPI and XAudio 2.
    Just look up the documentation for headers/librarieslike every other Windows API you use. If you have a hard time to find the documentation then you need to go to search engines and find search engine tutorials. 
    There are plenty of samples for both WASAPI and XAudio 2, both in the Windows SDK and online. The DirectX team has some suggestions on which to use on their team blog.
    You can find experts for those APIs at the Windows Desktop Pro-Audio Application Development forum and the
    Audio/XACT forum on MSDN (link left out for you to practice your search skills). Again, it is fine to ask for hints but don't ask the whole
    solution. You are competing with others who just need a hint to finish work here. The time spent on working on your assignment would be better spent on helping on giving hints to others. 
    Visual C++ MVP

  • Pause/Play button on toolbar

    When running a captivate slide show, and using the pause/play
    button on the customisable toolbar, we have noticed that when
    clicked this button does not pause any audio that may be currently
    running on the slide, therefore making the facility partly
    nonsensical. Is this a feature of Captivate 3.0, or is it just me
    not embedding the sound in the correct place????
    Please help.

    Hi Kate,
    My instincts tell me that you are experiencing a change in
    focus, but I'll tell you what I mean, and you can decide if that
    may be the problem. Assuming you are publishing to SWF/HTM output
    ... when your movie starts, what is actually happening is, you are
    opening a HTML document, and the movie (the SWF document) is
    "called" (commanded to open) by that (HTM) document. Therefore,
    when it is first begun, the computer's "focus" is on the HTM, not
    the SWF contained in it.
    Keeping that in mind, the first time you click (an object in
    the movie itself), the Windows operating system must change the
    focus
    from the HTM document
    to the SWF movie, which accounts for the first "click". The
    second time you click, the SWF document makes the correct
    assumption that the "click" is meant to be interpreted as a command
    intended for the object in the SWF movie.
    This behavior may vary, depending on the browser being used,
    and perhaps even the operating system (I'm guessing here, because I
    don't know how Windows Vista might treat the action of clicking in
    a browser window as opposed to the way Windows XP handles the same
    command-action).
    Another possible cause might be the mouse itself, or its
    software. You can check this easily enough, by seeing if the
    failure to function always occurs on the same machine, and if it
    changes when you install a different pointing device. I know from
    personal experience that sometimes I have to click really firmly,
    and sometimes not. I use a battery powered optical mouse, and its
    behavior is subject to change as the batteries get older.
    I don't know if there is any help in my comments ... I
    certainly hope so. Let us know, because sometimes when one member
    "hits a wall" in offering solutions, another member "sees a light"
    and a difficut problem ends up having a simple solution.
    All the best,
    Larry

  • Playback pauses and audio sync issues with live video stream

    I'm seeing playback pauses about every three seconds and audio sync issues with our live demo stream when using the OSMF/Strobe player.  It happens on both our 2Mbps 720p stream and our 480p 750Kbps stream so it does not seem to be related to higher resolution/bandwidth streams.  It also happens if I point directly to a stream asset or if I point to a .f4v with both streams listed for dynamic so it does not seem to be related to dynamic streaming specifically.
    The same live streams play back very well without pauses or audio sync issues in the Akamai's dynamic player and even slightly better with JW 5.2.
    I have viewed the OSMF/Strobe playback on three different laptops of various age (3 months to 2 years) and two are Windows and one is Linux.  I have also tried the various buffering options on the Flash Media Player Setup and Strobe setup and it has not made a noticeable difference.
    To see the stream with the Akamai player, go to:  http://live.kulabyte.com
    To see the stream with the OSMF/Strobe player, go to:  http://live.kulabyte.com/osmf
    I do not have JW set up for public viewing yet, but the two above show the distinct difference.
    We are really hoping to start pointing our customers towards the OSMF player because of the support provided by the community and Adobe, but we have to get the quality of the playback to be acceptable first.
    If someone has ideas on debugging I can PM the actual video assets to you.
    Thanks,
    Tim

    Hi Tim,
    You need to add this setting:
    dynamicStreamBufferTime=8
    The actual value can be higher or lower. The best practice is to use a value that is twice the keyframe distance. Anyway, try different values and see which performs the best for your content.
    I know that the setup page does not contain this option and it is not documented in the UserGuide. We simply missed it. Sorry.
    Also note that the dynamic buffering algorithms are not being used for dynamic streaming content. I tried to explain this here:
    https://sourceforge.net/adobe/smp/wiki/Dynamic%20Buffering/
    Looking forward to your confirmation that this solved your issue.
    -Andrian

  • Motorola s9-HD pause/play worked then didn't

    Am currently using the headset with my iPad but this happened with my Touch as well.
    When I initially set up the s9-HD with my phone and then the iPad the pause/play button worked no problem. I was trying out a different phone so repaired everything, didn't like the bluetooth reception on the phone i was trying so reset the headset and paired it again with my original phone and then iPad.
    Now the pause/play button doesn't work any more.
    I have looked at the Motorola forums for s similar issue and haven't found any answers.
    Any ideas?

    As was already pointed out in this thread, the iphone has never had full bluetooth capabilities ... so it is nothing to do with the S9-HD headphones. All that you could do with any bluetooth headset and an iphone was to 'play and stop/pause'.
    The ios 4.1 (release date Sept 8th) will include AVRCP (AVRCP is the mechanism which allows bluetooth headsets, or car dashboards to take full control of the audio functions of the devices they are connected to.)
    So most of this thread is moot.

  • Pause Streaming Audio

    I'm trying to pause streaming audio with a "pause" button.
    However, when I click the "play" button, the audio begins a few
    seconds after where it stopped.
    My theory is that the "pause" button isn't recording where
    the audio stopped playing; it's actually recording where the audio
    stopped loading. So if ten seconds of audio has played, but twenty
    seconds of audio has loaded, the "pause" button will record the
    pause position as twenty seconds, and the play button will start
    the audio at twenty seconds.
    Does that sound like a reasonable theory? Does anyone know
    how this might be fixed?
    Here's my code:

    Looks like my theory was wrong! When I hit the "pause"
    button, it records a number that corresponds to a point in the
    audio stream, but that number does not correspond to the point at
    which the audio stream was paused -- it's somewhere between two to
    five seconds later. I have no explanation as to why this is!
    So I guess my revised question is: has *anyone* been able to
    get the "pause" and "play" buttons to work properly with
    *streaming* audio? I've come across some comments that suggest that
    it might not be possible, but I've never seen it explicitly stated
    that it's not possible.
    In other words: should I give up?

  • What would cause my cd player to not play audio?

    what would cause my cd player to not play audio? when cd inserted into the computer it pauses for a few seconds &then ejects cd.

    theredness wrote:
    what would cause my cd player to not play audio?
    Your CD player? Or the CD drive in your MacBook Pro?
    Assuming the latter, several things. Begin with
    Intel-based Macs: Resetting the System Management Controller (SMC)
    <http://support.apple.com/kb/HT3964>

  • Captivate 4 - Advanced Actions - Pause/Play buttons

    Hi - So I have created a 2 buttons - a pause and play - so my users can pause/play my captivate video (audio and actual slide). I have created my 2 variables for the buttons and I have created my advanced action. I'm assigning my pause to 'rdcmndPause', hide pause, show play. And I'm assigning play to 'rdcmndResume', hide play, show pause. It's not working. The pause/play buttons appear and disappear like they should - but my project isn't pausing or playing. Any thoughts?

    You can create and use Widgets for Adobe Captivate 4 in AS2 as well Mike.
    If you go to your Captivate Installation directory and find the "Gallery" folder and "Widgets" then you should be able to find some AS2 Widget Source files. Take a look at the "Flash Button" widget. This is a relatively simple widget and you can basically just use the code framework to make your own button widget.
    If your end users have low-end systems then it's probably safer to stay with AS2 and publish towards Flash Player 8.
    /Michael
    Visit my Captivate blog with tips & tricks, tutorials and Widgets.

  • I have just got a iPod 5 gen 32gb and lightning adapter but can't get it to work with my docking station it will charge but not play audio please help??

    I have bought a 5th gen iPod and lightning adapter but it won't wrk on my docking station it charges but doesn't play audio? Please help

    Does the dock manufacture say it is compatible with the 5G iPod with iOS 6.0.1?
    Have you went to the manufacturer's support site? Contacted them?
    Try resetting the dock. How you do that depends upon the dock
    Sometimes this works
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:       
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

  • When i try to upload a .mts file from my Sony camera to Premiere Pro CC it refuses to play the audio! Ofcourse i could convert every single clip but it takes tons of time. How can i make Pr play audio track properly?

    When i try to upload a .mts file from my Sony camera to Premiere Pro CC it refuses to play the audio! Ofcourse i could convert every single clip but it takes tons of time. How can i make Pr play audio track properly?

    Does it not play at all or cannot you get the audio in the timeline?
    Did you copy the entire card to the hdd and then imported the file via the Media Browser?
    Did you source patch the audio tracks?

Maybe you are looking for

  • HP Pavilion dv9207us will not boot up

    This laptop is less than 2 years old.  One day, it locked up.  Upon hard reboot, nothing showed on LCD.  Connected an external monitor, showed bios coming up, etc.  However, the graphics were all messed up.  On the external monitor there are large gr

  • Songs dont even show up on my ipod anymore 2nd time happening

    I have a 4th generation ipod with color that shows the photo My ipod had recently somehow got rid of all my songs the first time i didnt kno how but by the 2nd time i had all my songs on there and i just plugged it into my computer last night to char

  • How do I make a submit button work on a mobile oriented page?

    How do I make a submit button work on a mobile oriented page?  I have the .html file and the .data file (and one other kind), but it just spins and spins and spins when I try to send the form in (for an absence).  I'd like it to work on all devices. 

  • Help needed with RA with Sales order scenario

    Hello Gurus, We are using SD-RR right now for our sales orders. We are facing difficulty with timing cost posting in that scenario and need your help with same. When we do PGI cogs posting is done. RR usually happens at at later point of time after c

  • New ios8 prevents me from deleting emails. Help

    WWhen I delete emails they keep reappearing and error message says I cannot move to trash in new iOS downlad.