Playing two audios at a time

I made a speaker check. That is working fine. But if i duble click speakrOn button sound playing 2 times (two audios at a time).
How to solve my problem?
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
mySound.load(new URLRequest("testAudio.mp3"));
speakrOn.addEventListener(MouseEvent.CLICK, onClickPlay);
speakrOff.addEventListener(MouseEvent.CLICK, onClickPlay);
function onClickPlay(e:MouseEvent):void
          speakrOn.visible = true;
          speakrOff.visible = false;
          myChannel = mySound.play();
          myChannel.addEventListener(Event.SOUND_COMPLETE, onAudioCompleteHandler);
function onAudioCompleteHandler(e:Event):void
          speakrOn.visible = false;
          speakrOff.visible = true;

var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var isPlaying:Boolean = false;
mySound.load(new URLRequest("testAudio.mp3"));
speakrOn.addEventListener(MouseEvent.CLICK, onClickPlay);
speakrOff.addEventListener(MouseEvent.CLICK, onClickPlay);
function onClickPlay(e:MouseEvent):void
         speakrOn.visible = true;
         speakrOff.visible = false;
          if (!isPlaying)
               myChannel = mySound.play();
               myChannel.addEventListener(Event.SOUND_COMPLETE, onAudioCompleteHandler);
                isPlaying = true;
function onAudioCompleteHandler(e:Event):void
          isPlaying = false;
          speakrOn.visible = false;
          speakrOff.visible = true;

Similar Messages

  • Is it possible to play two audio files simultaneously.

    Hi,
    Is it possible to play two audio files simultaneously.
    I modified the 'SpeakHere' to play two audio files simultaneously, it worked perfectly on simulator but get hanged on iphone.
    To this I implemented NSTimer, which regularly checks for both player instance every second.As soon as any player gets stopped Timer task stops the second one forcefully and again starts both.
    thanks.

    Hi Jay
    Do you have the eLearning Suite? If so, you have Adobe Presenter available to you. If you don't, you should be able to download the Presenter installation file and evaluate it.
    Presenter is an add in for PowerPoint. The neat thing about it is that it provides for a Table of Contents type of functionality as you see is configured in Captivate. But the twist with that is you are able to do something you cannot do in Captivate. You are able to insert videos inside the TOC area!
    Just musing out loud... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Playing two audio sources

    My friend and I like to watch the latest episode of our favourite TV show together, we'll call each other up on skype with voice only, then we'll both play the AVI file of the episode at the same time, its easier to make comments about the episode to each other this way than typing out on IM.
    This worked in Ubuntu, now that I am using Arch I don't know what settings Ubuntu had by default that I need to replicate.
    First, when trying to play anything in MPlayer anyway it would fail, but installing the `alsa-oss` package fixed that.
    Now when anything else is already outputting audio I get this message from MPlayer:
    Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
    AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
    Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
    ==========================================================================
    [AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or resource busy
    mplayer: libao2/audio_out.c:273: old_ao_init: Assertion `!global_ao' failed.
    MPlayer interrupted by signal 6 in module: ao2_init
    - MPlayer crashed. This shouldn't happen.
    Anyone know how to remedy this situation

    OK, so at the moment, my MPlayer config file has the ao=pulse parameter  in it. Then `mplayer Pocket\ Monsters\ -\ 119\ -\ Don\`t\ Touch\ That\ Dile.avi -v` returns
    Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
    dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer.
    MPEG 1.0 layer III, 128 kbit/s, 48000 Hz joint-stereo
    AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
    Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
    ==========================================================================
    Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
    [libaf] Adding filter dummy
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    Trying preferred audio driver 'pulse', options '[none]'
    AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
    AO: Description: PulseAudio audio output
    AO: Author: Lennart Poettering
    Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    Starting playback...
    and using alsa `mplayer -ao alsa Pocket\ Monsters\ -\ 119\ -\ Don\`t\ Touch\ That\ Dile.avi -v` returns
    Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
    dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer.
    MPEG 1.0 layer III, 128 kbit/s, 48000 Hz joint-stereo
    AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
    Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
    ==========================================================================
    Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
    [libaf] Adding filter dummy
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    Trying preferred audio driver 'alsa', options '[none]'
    alsa-init: requested format: 48000 Hz, 2 channels, 9
    alsa-init: using ALSA 1.0.24.1
    alsa-init: setup for 1/2 channel(s)
    alsa-init: using device default
    alsa-init: pcm opened in blocking mode
    alsa-init: got buffersize=96000
    alsa-init: got period size 1500
    alsa: 48000 Hz/2 channels/4 bpf/96000 bytes buffer/Signed 16 bit Little Endian
    AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
    AO: Description: ALSA-0.9.x-1.x audio output
    AO: Author: Alex Beregszaszi, Zsolt Barat <[email protected]>
    AO: Comment: under development
    Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    [dummy] Was reinitialized: 48000Hz/2ch/s16le
    Starting playback...
    I've got very confused by all this audio stuff with ALSA/OSS/PulseAudio.
    Those outputs along with audio were the same even if I was playing a YouTube video or not, but I think the YouTube video was using PulseAudio. I'm not sure though =\

  • How to play two videos at the same time

    Hi everyone!
    Ok, so what I'm trying to do is basically play two videos, which are already saved on the computer, at the same time. I can get one video to play, but when i try to start another it just displays a blank screen.
    import javax.swing.*;
    import javax.media.*;
    import java.awt.*;
    import javax.media.protocol.*;
    public class TwoVideoTest {
         public static void main(String[]args) {
         MediaLocator locator1 = null;
         MediaLocator locator2 = null;
         try {
         locator1 = new MediaLocator("file:/C:/truck1.mpg");
         locator2 = new MediaLocator("file:/C:/truck2.mpg");
         } catch(Exception e) {
         System.out.println("COULNDT CREATE LOCATORS IN MAIN TEST CLASS");
                          System.exit(-1);
         Player player1 = null;
         Player player2 = null;
                     try {
          player1 = Manager.createRealizedPlayer(locator1);
         player2 = Manager.createRealizedPlayer(locator2);
                      } catch(Exception e) {
              System.exit(0);
         JFrame frame = new JFrame();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel panel1 = new JPanel();
       JPanel panel2 = new JPanel();
        panel1.add(player1.getVisualComponent());
       frame.getContentPane().add(panel1);
       frame.setSize(new Dimension(500,500));     
       frame.setVisible(true);
       player1.start();
       player2.start();
    }

    HELLO AGAIN! I guess i post too soon....
    So i modified my code and now the videos play together. Threads, sigh.
    But the audio that comes with the video doesn't appear to be starting at the same time. And this problem I ASSURE you i have no clue how to handle. And yes i know, the two video audios will overlap, but this a test for heavens sake!
    Anyways, heres the modified code in case it will help anyone
    import javax.swing.*;
    import javax.media.*;
    import java.awt.*;
    import javax.media.protocol.*;
    public class Video implements Runnable{
         String url;
         MediaLocator locator;
         Player player;
         JPanel panel;
         public Video (String url,JPanel panel) {
              this.url = url;
              try {
                   locator = new MediaLocator(url);
                   player = Manager.createRealizedPlayer(locator);     
                   panel.add(player.getVisualComponent());
                   player.start();
              } catch (Exception e) {
                   System.out.println("ERROR CREATING MEDIALOCATOR");
                   System.exit(-1);
         public void run() {
              try {
              Thread.sleep(100);
              } catch(Exception e) {}
         public static void main(String[]args) {
            JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel panel1 = new JPanel();
              JPanel panel2 = new JPanel();
              panel1.setPreferredSize(new Dimension(100,100));
              panel2.setPreferredSize(new Dimension(100,100));
              Thread thread1 = new Thread(new Video("file:/C:/truck1.mpg",panel1));
              Thread thread2 = new Thread(new Video("file:/C:/truck2.mpg",panel2));
              frame.getContentPane().add(panel1);
              frame.getContentPane().add(panel2);
              frame.setSize(new Dimension(500,500));     
              frame.setVisible(true);
              thread1.start();
              thread2.start();
         

  • Playing two midi keyboards at the same time in logic for live show

    hello, i have a macbook pro 2.16 cpu, os 10.4.7, logic 7.1.1 and 7.2 is on the way
    1 gb of ram
    a tascma us-428 inerface
    i want to be able to play two diffrent midi keyboards at the same time is their a way to have one digital instrament for on keyboard, and another midi keyboard on a diffrent digital instrament at the same time, so as to play a live show?
    and also if i want to chang the intrament in the middle of a song becase it switches half way throw the song, is it posble to atomate this switch insted of doing it by hand? please help! thank you.

    here is some good reading regarding patch change
    http://discussions.apple.com/thread.jspa?messageID=2931940&#2931940
    http://discussions.apple.com/thread.jspa?messageID=1993033&#1993033
    http://www.logicprohelp.com/viewtopic.php?t=1045&highlight=instrumentprogram+programmechange

  • 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?

  • Any way to play two clips at the same time one over the other? (transprent)

    Any way to play two clips at the same time one over the other? (transprent)

    Yes.
    See the information here for a variety of ways to do this:
    http://discussions.apple.com/thread.jspa?threadID=933500&tstart=50
    http://discussions.apple.com/thread.jspa?threadID=903151&tstart=0
    http://karsten.schluter.googlepages.com/jackiechancredit
    http://www.geethree.com/slick/V_04.html

  • Can you play two different MIDI instruments at the same time in Garageband?

    Hi all,
    I searched for a while but failed to find an answer so far: can Garageband allow you to play two tracks with two different midi instruments? When I plug my two keyboards, the 2 MIDI sources are recognized, but can only play notes on one track, not two different tracks! Is this a known limitation?
    If Garageband can't play 2 midi instruments on 2 different tracks, I guess that leaves me with Logic Express...
    Thanks a lot for any reply!
    Alex

    Correct. GB doesn't differentiate between midi channels, that's why you can't split them to two tracks (and GB only offers one recording channel for midi at a time).

  • Play two video files at the same time.

    I am trying to play two video files at the same time. I create two threads, each of which has its own frame, playing button, and builds its own graph to play the file. Now everything seems works except that when the first file is being played and I hit PLAY
    to play the second file, the program plays the second file but the first one is paused; furthermore the control button has no response for the first one. Did I miss anything? Can anyone help me figure out the problem?
    Best,
    Fayin

    You don't need separate threads for 2+ playback pipelines because the filters create worker threads internally and don't block execution on calling thread.
    If you decide to keep separate threads, you will have to follow Michel's advice and have message pumps on those threads.
    You can also have both files in the same graph, in which case you have perfect sync between them (both start playing together in sync), however you cannot pause/stop/run files separately.
    The problem you described is most likely not a DirectShow problem and is rather about generic threading, COM or window messaging.
    http://alax.info/blog/tag/directshow

  • HT203167 I bought two audio books on iTunes but they will not play. My old books play without issue but the new ones do not.

    I bought two audio books on iTunes but they will not play. My old books play without issue but the new ones do not.

    Did you copy your actual iTunes content from your computer before reinstalling iTunes, or did you just copy your iTunes library which only contains the pointers to your songs / books locations ?
    You might, depending upon your country and if they are still in your country's store, be able to redownload your music purchases and your ibooks via the Purchased link under Quick Links on the right-hand side of the iTunes store homepage - you will need to delete the entries from your library (where you are getting the 'unable to locate' messages) before they will potentially show with the cloud icon against them in Purchased for redownloading.
    Or copy them from your backup of your downloads/library and add them to your iTunes library via File > Add To Library

  • Play two videos or SWF at the same time and play exactly concurrently

    Hi Everyone,
    I am creating one Flex application in which I have to play two videos concurrently or two SWFs concurrently.
    Both the videos of SWFs are overlapped on each other and these videos can be more than two also.
    So these all videos will play at the same time but user will feel like that this is a one video or SWF.
    And also there is no need of Play & Pause mechanism. It will be ok if its look like any loading SWF.
    I want something that can play all the videos or SWFs concurrently. It there will be some mismatch of timing than it will looks very ugly.
    Is any component  availble to do like this ? Or any other way to do like this ?
    Please help me..
    I am using Flash Builder 4.5 on windows 7.

    Hi Nicky
    As Bev. describes in iMovie. Best way !
    In FinalCut Express this is very easy. Picture in picture to Video-wall is so easy to do.
    Each video on it's own track (up to 99) and turn on VireFrame and change size so that each
    video has proper size and place. It's done.
    Just the easy ability to change size and rotation (parts of a degree) can do so much difference.
    Yours Bengt W

  • QT H.264 files with two audio tracks. Quicktime plays 2nd track first. ***?

    I've been experimenting with H.264 (AVC) and my DVDs. Using Handbrake, I ripped a DVD to MP4 (H.264) and including the director's commentary as the second track.
    When I play the MP4 with Quicktime Player, it plays the director's commentary instead of the main soundtrack. VLC, however, correctly plays the first track (main movie audio track) and it allows me to select the second track via a menu.
    To get Quicktime to play the proper track, I have to open "Movie Properties" and manually uncheck the second track. This was never a problem with DivX/XviD encoded files with two audio tracks; Quicktime Player correctly played the first track.
    Why does Quicktime ignore the first audio track in MP4s (but not AVIs) and is there a way to correct this?

    I do have QT Pro.
    H.264 files are usually saved in a MP4 container. That's what Handbrake, ffpegX, and D-Vision create, anyway.
    The "Choose Language" option is greyed out (unavailable) when I open this H.264 MP4 in Quicktime. If I try to change the settings in "Movie Properties," it says that I must save it with the .MOV file suffix.
    It makes no sense to me that Quicktime Player can correctly identify the main audio soundtrack in a XviD file with an AVI container but not in a H.264 video with a MP4 container which Apple has been touting as the latest, greatest thing. Even VLC, an open source product still in beta, gets it right.

  • Recording to two audio tracks at same time

    I am having trouble recording a vocal on track one and a guitar, (via second microphone)
    onto track two. I am going through an Apogee, and I have phantom power enabled on both
    mics. However when I click the record button on one track it seems not possible to click
    the record button on the other track. I have input monitoring button selected on both tracks
    and the main record button selected.
    Any suggestions at all will be most welcome. I have looked in previous forums and read and
    tried various options, but no luck at all so far.
    Thanks very much

    Hello to Data Stream Studio and howdy cowbell bill. Thanks you both for your replies
    and it sounds like you are both in agreement as to what the problem is.
    Keeping in mind what you suggested,
    I went back onto Logic this morning, but I'm still having the same problem of not being able
    to record enable two audio tracks simultaneously. I have checked both mics and both mic
    cables, and the breakout cable that leads into the Apogee pre-amp. Those things are all OK.
    I've now tried to back-track and to trouble-shoot what little I know. This is what I've done :
    1: Shut down and re-opened Logic
    2: Opened a new project.
    3: Shut off the phantom power for both mics
    4: Disconnected both mics and cables
    5: Opened a new audio track (track one)
    6: Assigned mic 1 to audio track one.
    7: Assigned mic 2 to audio track two.
    8: Re-connected cables
    9: Turned the phantom power back on for both mics.
    10: Enabled the input enable/monitor button for both tracks (in the track header)
    11: Turned on the main record button in the transport bar.
    12: Tried to turn on the record button for both tracks. (in the track header)
    11: I can only turn on one at a time. As soon as I click one the other
    one turns off.
    I have the mixer turned on and can see that both tracks are in Mono.
    I am wondering if the way I have the Apogee set up might be the problem?
    I have the original Apogee Duet. Phantome power is displayed with two red LEDs
    which show up on the front to the unit. Both are illuminated when phantom power is
    powered on. I have the volume turned up fully for both mics (via. the Apogee control
    panel that shows up on my computer screen). HOWEVER, when clicking the controller
    knob on the top of the Apogee unit itself I don't seem to be able to see the two mics
    being shown up on the computer screen at the same time. (I hope this makes sense).
    I seem to remember a display that shows mic one icon, a display that shows mic 2 icon,
    a display that shows the headphone/speaker icons, and a display that shows both
    mic one icon and mic two icon.
    Thanks for any help you might be able to give me on.
    I am sorry this post is so long but I wanted to try to explain
    the problem as clearly and as unambiguously as I am able.

  • Play two instruments at the same time?

    Hi!
    I'm stuck with GarageBand right now, where I can only play one instrument at a time. Preferably I want to play both (for example) piano and strings using one real-time MIDI input. Is it possible to do that with either Logic Express or Pro?

    Do you mean play the same thing at once with two instrumets simultaneously playing two different sounds?

  • RE: Capture Problems on External Drive/Audio drift over time

    Greetings FCP gurus -
    I posted earlier on the LAFCPUG board and now seek worldwide assistance with a problem I can't seem to resolve.
    Been working in FCP since 1.5. Been successfully capturing on external FW devices for over 4 years with an old 500 MHz Powerbook - no problems.
    I recently upgraded to FCP 5 Studio on a PowerBook 1.5 GHZ 512 RAM FW 4/8 machine. Prior to upgrade, I was running Panther (OS X 10.3X) and FCP 4.5 HD. This configuration allowed me to flawlessly capture to external FW drives from Panasonic AJ-D250 DVCPRO deck using a standard DVNTSC codec. Prior to that I was also able to do the same from a Sony DSR-11 deck. No longer.
    I now get a constant audio "drift" every time I capture. I've tried shortening the clips to under 10 minutes - even as small as 5 minutes - but the audio progressively drifts as the clip plays on. This is true in both FCP and QT. I completely reformatted the laptop/wiped the drive prior to install (Unjournaled) and it currently has 25 gig available disk space on the 80 gig internal drive. Additionally, I'm using LaCie 7200 RPM Oxford 911 chip-set external drives. I've tried with clean D2 FW 800 and Porsche FW 400 drives to no avail - even reformatted one and still no luck.
    Current configurations attempted:
    FW 800 PB port to FW 800 drive port/DVCPRO deck to FW 400 PB port
    FW 800 PB port to FW 800 drive port/DVCPRO deck to FW 400 drive port
    FW 400 PB port to FW 400 drive port/DVCPRO deck to FW 400 drive port
    ..and so on.
    I'm at wit's end and appreciate any insight. Is anyone else having issues capturing to External FW media via FCP 5 Studio/OSX 10.4.x? I don't currently have the option of internal drives to capture as I'm working at a client site. Additionally, I sold my FCP 4.X upgrade software so going backwards is not an option either... Even took the deck home and tried this same trick on my home machine (Dual 500 G4 Sawtooth) to the internal ATA drive with the same result -...drifting audio. Since upgrade this is my first capture and needless to say it's not going well.
    Help, information and insight are greatly appreciated. Thanks

    Hi Expressofiend! Were you able to resolve this issue yet? We are having an IDENTICAL problem. We shoot on a Canon XL2, and thought that might be causing the audio drifting issue? We also have a Panasonic AD-J 250 deck, and when we capture, say an interview, the lip sync is perfect for a few minutes, then drifts as much as a second or two over 20 minutes of capture. It's making us crazy. Happens when we capture to an external LaCie or our internal drive. We're using Apple's 2.7 gig duel processor computer. 2 Gig of ram, all the latest versions of Tiger, Final Cut Pro 5, etc. If we look at the Quicktime movie - it shows the audio drift - you don't even need to view it through Final Cut!
    Interestingly, if we use the Canon XL2 camera as the source player when we capture the 20 minute piece - there is NO audio drift or syncing problem. Only with the AJD 250! We've spoken with the senior engineer at Panasonic - he doesn't think it's the DVCPro unit. Says drifting audio isn't the kind of thing an out of adjustment or broken deck would do.
    Anyway, any answers here yet?
    Thanks,
    Larry

Maybe you are looking for