Stopping a stream sound

how do we stop a streaming sound?
sound.stop();
or
sound.close();

there is no sound.stop() so sound.close() would be the better of the two options.  and, if you had a choice between the soundchannel.stop() and sound.close(), close is better.

Similar Messages

  • Stop/Start Streaming Mp3 Sound- Button Script

    I'm looking for a button script to stop a streaming mp3 sound
    playback on the first click, then start it again on the second
    click and so on.

    You need brackets after the function call...
    playMusicFunc();

  • Problem streaming sound only to Apple TV

    Apple TV with the latest software of of Nov 23
    Macbook Pro with Retina Display running 10.10.1
    - I can see my itunes lib through home sharing and is able to play movies, see photos without any issue.
    - I can mirror my desktop using airplay and play movies and music without any issues.
    The issue comes when I try to stream sound only on to Apple TV. I have the ATV connected to my audio player and stream Spotify. The sound is choppy and broken. Going against my instinct I purchased a new router (Asus RT-AC68U) which obviously was not the issue since airplay was working on when I mirror my desktop.
    After a couple of hours with apple support, I saw on the forum that some people has issues with bluetooth. I TRIED TURNING OFF BLUETOOTH AND IT FIXED THE SOUND STREAMING TO ATV. I have an apple blue tooth mouse.
    I tried both shortcuts, from preferences - sound - output and Apple TV and using Option + Sound Icon to select Apple TV instead of internal speakers. Both have the same problem.
    I hope its a software issue rather than a hardware one and it can be updated soon.

    A Follow up on this issue , bluetooth also stops AirPlay from working reliably.

  • StopAllSounds vs. new Streaming Sound not playing

    In my timeline, I'm using a stopAllSounds action (because the
    user could be coming from anywhere in the movie and I need to stop
    whatever narration might be playing), then, in the next frame, I'm
    trying to stream a new sound. My problem is that the streaming
    sound doesn't play. I've tried adding a few frames between the
    stopAll Sounds action and the start of the streaming sound, but
    that doesn't seem to be the problem. Any ideas would be greatly
    appreciated.
    - BillG

    I was about to try your suggestion, but after sending a few more test emails, I discovered that it does in fact play the sound sometimes.  I sent about 20 test emails, and they were all received using the "idle" command, with about 75% of them playing the sound.  There was a 5-10 second delay between the messages being received and the sound playing that I don't remember from Snow Leopard, but I'm not positive about that.
    It shouldn't be the actual sound that is the issue, being that it is played sometimes, but I still don't know why it's not playing every time.  I tried receiving messages with the app running in the background, with it minimized, and with it as the active window, but I couldn't find any specific instance that caused it to not play the sound.
    I wasn't having this issue in Mail 4.  It didn't start until I installed Lion, which I did a clean install of, if it matters.
    I'm still open to thoughts on this, and thank you for your help.

  • Event when streaming sound is ready to play

    Hello,
    I'd like to know, when a streaming sound has preloaded enough
    and would
    start to play.
    Since I have also to preload some images and xml files, I
    load a
    streaming sound, stop it immediately and when everything has
    enough
    buffer, I want to start them all manually...
    How can I do this?
    josp

    Hi josp,
    I have the same question and I'm wondering--did you ever
    figure it out?
    Thanks,
    mew

  • I have just started with apple tv. I rented and downloaded a movie from itunes on my macbook pro and tried to watch it. I got the movie up, but it only played a picture for about 3 seconds and then stopped, also no sound? What am I doing wrong?

    Please help me play a rented itunes video on apple tv. Have a pictue and movie runs for about three seconds, and then stops. No sound? But I can play any music from my library with sound?

    Is the movie still buffering? you may have a slow internet connection. Music files require far less bandwidth than movies.

  • My imported swf files have lost their streaming sound. What can I do?

    I am trying to import a swf I made that contains streaming sound. When I place it on the time line and press cntr enter my animation plays but with no audio. I see the symbols from the swf and the swf inside my library. When I open the swf file inside my project it is broken down frame by frame with no audio. I can add audio back into my movie clip so I know that movie clips can support streaming audio. But I would rather not have to do this.
    I'm very new to flash so I am hoping there is something big that I am missing.
    In addition to my previous question: I need to embed a lot of objects over and over in this project I am working on. Each object will have controls for play back of itself. Is there some reason I cannot do this?
    Thank you for any advice you may have.

    Thank you for your reply
    Ok. I will need to maintain a libary of movie clips that contain streaming audio and simple scripts. Does anyone know of a good tutorial for importing a file at runtime? I've seen something called shared libary properties and it has a field for a url. I put a swf file on my web site and took it's url and put it into this field but nothing shows in my library. What else do I need to do?

  • Stop/Play All Sounds Too

    Hi There,
    The play / stop button I have works...but the sound files
    continue playing.
    This is the script I have:
    button1.onPress = function() {
    MovieClip.prototype.onEnterFrame = function() {
    if (_root.direction == "stop"){
    this.stop();
    }else {
    this.play();
    _root.direction = "stop";
    button2.onPress = function() {
    _root.direction = "go";
    //delete MovieClip.prototype.onEnterFrame;
    is there any way to stop/play the sound files (in the current
    frame) also?

    David Stiller wrote:
    > cyphernic,
    >
    >> The play / stop button I have works...but the sound
    >> files continue playing.
    >
    > Heh, so does it work? ;)
    >
    >> This is the script I have:
    >>
    >> button1.onPress = function() {
    >> MovieClip.prototype.onEnterFrame = function() {
    >> // etc.
    >
    > That's a bit more complicated than you actually need, I
    think. Give
    > this article a shot, and write back if you still have
    trouble. :)
    >
    >
    http://www.quip.net/blog/2006/flash/how-to-toggle-sound-globally
    Solution is simple and ok but you don't actually stop the
    sound, just mute
    it so it continue to play tho you just don't hear it.
    You can toggle stop start using simple boolean
    buttonName.onPress = function() {
    (playing=!playing) ? sound1.stop() : sound1.start(0, 999);
    Assuming the sound was attach using something like :
    sound1 = new Sound(this);
    sound1.attachSound("loopSound");
    sound1.start(0, 999);

  • Has Mavericks stopped my Airplay sound?

    I have recently purchased a new MacBook Pro, I was hoping the new addition would solve the problem I've been having with my Apple TV. Both my new MacBook and my iMac, which is only 4 months old, are both running Mavericks and both have stopped playing any sound through my Apple TV. Has anyone else been having this problem?

    Hello jomon95,
    I understand that AirPlay is an important feature of the Apple TV, and I would be concerned too if the audio was not working using AirPlay.
    Because both your MacBook pro and your iMac are very new (congratulations!), I recommend first checking to see if your Apple TV has the latest updates:
    To update your Apple TV to the current software version:
    Select Settings > General > Update Software. Apple TV checks for an available update; if one is available, a download message should appear.
    Click Download and Install to start the download process.
    Do not disconnect your Apple TV during the update process. The Apple TV status light may flash slowly during the update and restart process. This is expected behavior.
    Apple TV (2nd and 3rd generation): How to update Apple TV software
    http://support.apple.com/kb/ht5706
    If your Apple TV is up to date or the audio is still not working, I recommend following the steps in this article:
    iTunes: Troubleshooting AirPlay and AirPlay Mirroring
    http://support.apple.com/kb/TS5209
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Stop and Start sounds

    Good morning All,
    I have a Flash presentation that has some music and various sounds throughout the presentation.
    I want to have a btn stop all the sounds, but if clicked again it will enable all the sounds again.
    Is this possible? I can get the btn to stop the sounds, but cannot get the music to enable after.
    Any help is greatly appreciated,
    Cheers-
    Graeme

    if you're using stopAllSounds(), all sounds are enabled after that executes.  they won't restart but they're enabled.
    if you want to re-start all stopped sounds, you'll need to explicitly do that for each sound instance.

  • My iphone 4 speakers stopped giving me sounds when i play audio or video even while gaming. It works fine when ringing tunes of for voice mails. What is wrong with it?

    My iphone 4 speakers stopped giving me sounds when i play audio or video even while gaming. It works fine when ringing tunes of for voice mails, even works fine with headsets. What is wrong with it?

    well i'd seriosly say point a hot hair drier at the speakers as water has entered the phone most commonly via the home button but avoid getting it too hot let it cool every 3 minutes after constant drying. Don't worry I have honestly dont this with my iPhone 4 GSM 16GB. For future reference avoid letting it get wet.

  • Clicking noise when streaming sound to SourceDataLine

    Hello,
    I'm trying to stream sound to the PC's speakers using SourceDataLine, but I have trouble getting rid of a clicking noise.
    It seems to occur when sourceDataLine.available() equals sourceDataLine.getBufferSize(). Is there a way to avoid this?
    I am dealing with an audio of indeterminate length. Here's the test code:
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.DataLine;
    import javax.sound.sampled.LineEvent;
    import javax.sound.sampled.LineListener;
    import javax.sound.sampled.LineUnavailableException;
    import javax.sound.sampled.SourceDataLine;
    public class PlaybackLoop implements LineListener {
       SourceDataLine sourceDataLine;
       AudioFormat format;
       public PlaybackLoop() throws LineUnavailableException {
          AudioFormat.Encoding
              encoding = AudioFormat.Encoding.PCM_SIGNED;
          int sampleRate = 8000; // samples per sec
          int sampleSizeInBits = 16; // bits per sample
          int channels = 1;
          int frameSize = 2;  // bytes per frame
          int frameRate = 8000; // frames per sec
          // size of 1 sample * # of channels = size of 1 frame
          boolean bigEndian = true;
          format = new AudioFormat(
                encoding,
                sampleRate,
                sampleSizeInBits,
                channels,
                frameSize,
                frameRate,
                bigEndian);
          // PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, big-endian
          DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
          sourceDataLine = (SourceDataLine) AudioSystem.getLine(info);
       public synchronized void play() throws LineUnavailableException,
                                              InterruptedException {
          int bytesPerSec = (int) format.getFrameRate() * format.getFrameSize();
          int intervalMs = 200;
          int loop = 50;
          int bytesSize = bytesPerSec * intervalMs / 1000;
          byte[] bytes = new byte[bytesSize];
          // creates a high pitched sound
          for (int i = 0; i < bytesSize / 2; i++) {
             if (i % 2 == 0) {
                writeFrame(bytes, i, 0x05dc);
             } else {
                writeFrame(bytes, i, 0x059c);
          sourceDataLine.open(format, 16000);
          sourceDataLine.addLineListener(this);
          int bufferSize = sourceDataLine.getBufferSize();
          System.out.println(format.toString());
          System.out.println(bufferSize + " bytes of line buffer.");
          long nextTime = System.currentTimeMillis() + intervalMs;
          sourceDataLine.start();
          for (int i = 0; i < loop; i ++) {
             int available = sourceDataLine.available();
             if (available == bufferSize) {
                // clicking noise occurs here
                System.out.println("*");
             int w = sourceDataLine.write(bytes, 0, bytesSize);
             long currentTime = System.currentTimeMillis();
             if (w != bytesSize) {
                System.out.println("Not all written.");
                // TODO
             // time adjustment , to prevent accumulated delay.
             long delta = (nextTime - currentTime);
             long wait = intervalMs + delta;
             if (0 < wait) {
                this.wait(wait);
                nextTime += intervalMs;
             } else {
                nextTime = currentTime + intervalMs;
          System.out.println();
          System.out.println("End play()");
       public static void main(String[] args) throws LineUnavailableException,
                                                     InterruptedException {
          new PlaybackLoop().play();
       public static void writeFrame(byte[] bytes, int halfwordOffset, int value) {
          writeFrame(bytes, 0, halfwordOffset, value);
       public static void writeFrame(byte[] bytes, int byteOffset,
                                     int halfwordOffset, int value) {
          byteOffset += 2 * halfwordOffset;
          bytes[byteOffset++] = (byte) (value >> 8);
          bytes[byteOffset++] = (byte) (value >> 0);
       public void update(LineEvent event) {
          System.out.println();
          System.out.print("Update:");
          System.out.println(event.getType().toString());
    }

    I have modified the code so that it shows how the audio goes out of synch
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.DataLine;
    import javax.sound.sampled.LineEvent;
    import javax.sound.sampled.LineListener;
    import javax.sound.sampled.LineUnavailableException;
    import javax.sound.sampled.SourceDataLine;
    public class PlaybackLoop implements LineListener {
         SourceDataLine sourceDataLine;
         AudioFormat format;
         public PlaybackLoop() throws LineUnavailableException {
              AudioFormat.Encoding
                    encoding = AudioFormat.Encoding.PCM_SIGNED;
              int sampleRate = 8000; // samples per sec
              int sampleSizeInBits = 16; // bits per sample
              int channels = 1;
              int frameSize = 2;  // bytes per frame
              int frameRate = 8000; // frames per sec
              // size of 1 sample * # of channels = size of 1 frame
              boolean bigEndian = true;
              format = new AudioFormat(
                        encoding,
                        sampleRate,
                        sampleSizeInBits,
                        channels,
                        frameSize,
                        frameRate,
                        bigEndian);
              // PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, big-endian
              DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
              sourceDataLine = (SourceDataLine) AudioSystem.getLine(info);
         public synchronized void play() throws LineUnavailableException, InterruptedException {
              int bytesPerSec = (int) format.getFrameRate() * format.getFrameSize();
              int intervalMs = 200;
              int loop = 400;
              int bytesSize = bytesPerSec * intervalMs / 1000;
              byte[] bytes = new byte[bytesSize];
              // creates a high pitched sound
              for (int i = 0; i < bytesSize / 2; i++) {
                   if (i % 2 == 0) {
                        writeFrame(bytes, i, 0x05dc);
                   } else {
                        writeFrame(bytes, i, 0x059c);
              sourceDataLine.open(format, 16000);
              sourceDataLine.addLineListener(this);
              int bufferSize = sourceDataLine.getBufferSize();
              System.out.println(format.toString());
              System.out.println(bufferSize + " bytes of line buffer.");
              long nextTime = System.currentTimeMillis() + intervalMs;
              sourceDataLine.start();
              for (int i = 0; i < loop; i ++) {
                   int available = sourceDataLine.available();
                   if (available == bufferSize) {
                        // clicking noise occurs here
                        System.out.println("*");
                   int w = sourceDataLine.write(bytes, 0, bytesSize);
                   if (w != bytesSize) {
                        System.out.println("Not all written.");
                        // TODO
                   // printing time drift
                   if (i % 100 == 0) {
                        long currentTime = System.currentTimeMillis();
                        // this number increases
                        System.out.println(nextTime - currentTime);
                   nextTime += intervalMs;
              System.out.println();
              System.out.println("End play()");
         public static void main(String[] args) throws LineUnavailableException, InterruptedException {
              new PlaybackLoop().play();
         public static void writeFrame(byte[] bytes, int halfwordOffset, int value) {
              writeFrame(bytes, 0, halfwordOffset, value);
         public static void writeFrame(byte[] bytes, int byteOffset,
                                             int halfwordOffset, int value) {
              byteOffset += 2 * halfwordOffset;
              bytes[byteOffset++] = (byte) (value >> 8);
              bytes[byteOffset++] = (byte) (value >> 0);
         public void update(LineEvent event) {
              System.out.println();
              System.out.print("Update:");
              System.out.println(event.getType().toString());
    }The output looks like this:
    PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, big-endian
    16000 bytes of line buffer.
    Update:Start
    200
    1200
    1450
    1700
    End play()
    The printed number keeps on rising. (Maybe I'm not sending enough information to the audio input stream?)
    The printed number should be stable if in synch, but it continues to rise, signifying that it's playing audio faster than it's being provided. When the audio input source is from a network streamed audio (instead of the test audio source in this example), it results in a buffer under run, which causes the clicking sound.

  • Flash animation with stream sound not playing in mac

    Dear all,
    I have made a 5 min animation with stream sound. Its playing perfectly in PC. But in mac, its not playing. Stream sound starts from frame 60. So mac plays the swf plays till 60 frame, after that it pauses. I tried importing different sound format (wav, aif, mp3) and tried with all sound export setting but the problem remain same; its playing only till 60. When i removed the sound, it played till end. Even with event sound, it plays till end. But with stream sound, the problem. The problem is only in mac; in pc its perfect.
    I am using VMware Mac OS x leopard in window xp for testing purpose. I tested it in laptop with mac; but the problem is same. What could be the solution?
    Thanks in advance. Waiting for solution.
    Bhushan Pradhan
    spherenepal.com

    Dear all, I solved the problem myself. The problem was with the sound driver of mac. After installing sound driver, the problem is gone. Bhushan

  • RemoveChild and Stop all Animation/Sound plz help!!

    Hey hope someone can help me out with this, been stuck on this for a while now and tried a number of different way but no luck so far.
    Im trying to removechild and at the same time stop all the on going animation and sound, in a way reset them so that if this child is added again it plays like it did the first time.
    I've tried these scripts but non work, either i get an error or the sound doesnt stop and the animations stack:
    //==================================================
    1.
    bgFarm.stopImmediatePropagation()
    2.
    while (bgFarm.numChildren != 0)
    bgFarm.removeChildAt(0);
    3.
    gameMain_Controls.islandBG.removeChild(bgFarm);
    ===================================================
    the bgFarm is added to the main background from another class
    thx, hope someone can help
    pavel

    If all are done in script things are easier but I assume you're using timeline MovieClips. Generally speaking, stop() stops the timeline and removeChild() removes a DisplayObject (such as MovieClip) from a DisplayObjectContainer (such as Sprite and MovieClip). As for the sound, if you manage it by script it's easy to stop a sound with SoundChannel.stop(), but if your sound is on the timeline you have not much control. Either SoundMixer.stopAll() (but this stops ALL the sounds) or set SoundTransform volume to 0.

  • 8kHz sample rate option broken for stream sounds in CS5

    I've made several test files where all I do is add a sound to a keyframe, set it to Stream sound, add a sufficient number of frames to hear the sound (about 300), then change publish settings to override as MP3 with "use 8kHz sample rate" option.
    Testing movie yields a SWF that has NO SOUND at all.
    Changing the sound to Event sound and republishing PLAYS THE SOUND AS EXPECTED.
    Changing it back to Stream sound and turning off the "use 8kHz sample rate" option again yields a SWF that has NO SOUND at all.
    It seems to make no difference what sound I import and use.
    I'm on a Mac Octocore.
    This Publish Setting appears to be broken in Flash CS5.

    The only setting that I could find in compressor that lets your change the bitrate to 44.1 is when you create a new dolby digital setting and then under the inspectors audio tab/Target System button, change the button to Generic AC-3. When done, you can change the Sample Rate to 44.1.
    Hope this helps?

Maybe you are looking for

  • Mac OS 10.7 (Lion) won't start After Effects CS5.5 because it's a powerpc app!?

    I've had CS 5.5 Master Collection installed on my Mac since it came out. All the CS 5/5.5 apps I've used up to now have worked fine, in 64-bit mode (Photoshop, Illustrator, Acrobat Pro, InDesign). Now I need to use After Effects, but I can't get it t

  • Audio Drop

    Hello. This is my first post. Since day 1 of owning my Mac Pro, I've had a very strange audio issue. I'm using a MOTU Traveller audio interface. When I first start up, sound works fine. However, if I stop audio and then try to start again, half the t

  • Oracle AQ to Websphere MQ Architecture

    Hi, I am trying to architect solution involving Oracle AQ to Websphere MQ connection. I have question regarding using MQ client connection. If AQ connects to Websphere MQ as Client, does the message roll back to AQ queue if the MQ queue manager/queue

  • I18n for the next release of KDE

    I'd love to have KDE in spanish, so if you could....

  • A30 Modem Problem - Does it work with XP SP2 ?

    HAS ANYONE GOT AN A30 (P4 3Ghz) INTERNAL MODEM WORKING WITH XP-SP2 ? I've recently upgraded the hard disk in my A30 and installed XP SP2 and all the latest Windows updates and found most of the latest working drivers, but the last thing I'm trying to