Stream to Sound object

Hi,
I have the below snippet
stream = new NetStream(netConnection);
stream.client = this;
stream.play("FILE_NAME");
which basically plays a stream located on my Flash Media
Server.
Instead of playing the flv file with the stream object, I
want to make use of the Sound object , sth. like
var request:URLRequest = new URLRequest(url);
var s:Sound = new Sound();
s.load(request);
How can I achieve this, any snippets

You'd have to use an RTMP address, which the Sound object
can't get to. I'm not sure if this is because of encoding problems
or simple because rtmp can't be accessed that way. Also, a lot of
the functionality of the SoundChannel object is lost (like any
attempt at visualization) when streaming through FMS.
I like how the LiveDocs list explicitly "stream through FMS"
as one of the options for the Sound object, but offer no
explanation of how to do so.

Similar Messages

  • How to flush the loaded bytes of a Sound object

    Hi all,
    I've now been looking for a solution to my problem for quite
    a while now, but so far without any success, so I thought I'll give
    this forum a try.. maybe someone in here can help ;-)
    Ok here's the deal: I'm trying to create a simple audio
    player in flex that is able to play mp3 audio streams. I'm not
    looking for a solution that works with an FMS (Flash Mediaserver)
    and I do also not need code that shows me how to play a remote mp3
    file (which of course is also some sort of streaming streaming). I
    have an icecast internet radio server which is streaming a constant
    flow of mp3 encoded data. I can connect to that stream with
    standard media players like winamp or mplayer.
    I've been playing around with the
    URLRequest-SoundLoaderContext-Sound-SoundChannel-combo and tried
    many different combinations, but somehow the Sound object won't let
    go of the bytes it already played. The Sound.bytesLoaded will just
    keep increasing and my memory will just keep being eaten by the
    Flashplayer. Is there any way to free that memory again without
    having to destroy the Sound object? Or if I have to destroy it, how
    do I make sure that the user doesn't realize that I just switched
    the old Sound object with a fresh and empty one?
    I was also trying to get a NetConnection-NetStream-combo to
    play my stream, but here I failed even sooner: Even though the
    NetStream seems to be receiving the data from my server (Firefox
    states that it is receiving data after I invoke
    NetStream.play(url_to_stream)) I'm not able to get that data to
    come out of my speakers. I just can't hear anything :-(
    I'm pretty new to flex, as and flash, so please forgive me my
    ignorance ;) I really tried to figure this one out for about 3 days
    now..
    I'd be very grateful for any hints or advice :-)
    cheers,
    Lorenz
    Edit: oh yeah right: I don't know if this is too obvious, but
    I'm using flex3 :-)

    kurusaki wrote:
    i need to get the serial number of a X509Certificate
    the getSerialNumber() methode of X509Certificat return an BigInteger then can see in (windows application) or in the debuger of eclipse that the serial number is coded in HEXA
    how i can getting it in HEXA.
    If you look at the Javadoc for BigInteger you will see a toString() method that allows one to specify the radix. Hex is just radix 16.

  • How to close the Sound object

    I'm using Flash CS3, running code in ActionScript 3.
    I use the Loader class to load a child SWF file, which then
    takes over the entire area on my website that is reserved for
    Flash. If the user decides to stop watching the SWF file before it
    is completed, he hits the "close" button within the child SWF,
    ultimately causing the Loader.unload() method to be executed. So
    far, so good, only the sound from the remaining portion of the SWF
    file keeps playing. According to the Flash Docs for the
    Loader.unload() method:
    "As a best practice, before you unload a child SWF file, you
    should explicitly close any streams in the child SWF file's
    objects, such as LocalConnection, NetConnection, NetStream, and
    Sound objects. Otherwise, audio in the child SWF file might
    continue to play, even though the child SWF file was unloaded."
    It then gives an example that assumes you already have access
    to the Sound object, so closing the Sound object is done by:
    mySound.close();
    The only problem is that I have no idea how to access the
    Sound object when I use the Loader.load() method. Where is this
    beast? I can't seem to find anything in the documentation that
    tells me how to find the Sound object after calling Loader.load().
    As a temporary fix, I modified the target SWF file so that when the
    "close" button is hit, it calls the "stop()" function; however,
    this only stops the sound, it does not close the associated Sound
    object, and I presume it continues to lurk around in memory with
    nothing useful to do. (When the user hits the "close" button in the
    child SWF file, it creates a "bubbling" event so that the Loader
    class can call the Loader.unload() method on it.)
    I've attached code for your reference.
    Any help is deeply appreciated!
    -Dan

    Ack! Looks like I hijacked this thread, sorry.
    I'm doing almost exactly the same thing the OP is doing...
    Loader class to load an external SWF (which is a video file FLV).
    If the user hits the "close" button on the video, the video goes
    away as it should but the audio continues.
    I understand that I need to close any NetConnection and
    NetStream objects in addition to unloading the movie. What I don't
    understand is how to do that. I'm sure that it's a syntax thing I'm
    just not getting right. I would just really like a more detailed
    explanation of stopping NetConnections and NetStreams (but an
    explanation for the not-so-actionscript-experienced LOL).
    Thanks.

  • Sound Object and Media Display

    I'm creating a music player that uses xml generated from a
    database to load a song. One of the attributes of the xml is the
    path to the mp3 file. The attribute is stored in a generic object
    and is then passed as a function parameter. There's a lot of
    information i'd like to use from the id3 tags but the only object
    that supports them is the Sound object. I need the files to stream
    so they aren't cached onto the local system and have a media
    component to control playback.
    If I create a sound object and use the file path parameter in
    the loadSound method I can grab the id3 tags but the media
    component doesn't have control of playback and the files are
    cached.
    mySound:Sound = new Sound();
    mySound.loadSound(pathparam, true);
    If I just load the file path into the media component it
    starts playing right away and streams with the lovely built-in
    progress bar but I can't seem to access the id3s.
    mediaComponent.setMedia(pathparam, "MP3");
    Is there a way to load an actual Sound object into the media
    component so they will stream but also have access to the id3s?
    Thanks in advance for any tips!

    How can this NOT work????
    //Create an instance of the Sound class
    var soundClip:Sound = new Sound();
    //Create a new SoundChannel Object
    var sndChannel:SoundChannel = new SoundChannel();
    //Load sound using URLRequest
    soundClip.load(new URLRequest("chimes.wav"));
    //Create an event listener that wll update once sound has finished loading
    soundClip.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
    function onComplete(evt:Event):void {
    //Play loaded sound
    sndChannel = soundClip.play();
    Taken directly from:
    http://flashspeaksactionscript.com/loading-external-sounds-using-as3/
    I hear nothing.

  • Sound Object misbehaviour

    hi,
    I am making some training modules in flash. The modules are
    spaned from 300-1000 seconds.
    When I play the module it plays in sych with the animation
    but as we proceed the sound starts leading the animation. And this
    diffrence keep on incresing. I have tested both stream and event
    sound. I tried to make smaller sound units but still it doesnot
    The event cannot be implemented since this presentation is
    simulation need to be paused sometimes.
    I am playing this in a engine which organizes such more
    files.
    One more issue is that when i pause the simulation for a long
    time say 10-15 mins then this difference is quite large.
    please help me.

    kglad wrote:
    > open_1 = new Sound(this);
    This way the _root is used. In the case of using more than
    one Sound
    Object can have problems. eg. when attributing a new value to
    the volume
    of an object, all the other Sound Objects will receive the
    new value.
    To use a movieclip for each object is the most correct.
    this.createEmptyMovieClip("objOpenSound",
    this.getNextHighestDepth());
    open_1 = new Sound(objOpenSound);
    open_1.attachSound("open_1");
    this.open_1.start(0, 1);
    Erick Souza
    www.ericksouza.com

  • Record microphone to Sound-object

    Hello,
    is there a way to record sound from an attached microphone and get the result as a Sound object or save it on a server as MP3 (and then load it again into a Sound object, which would be easy)?
    I searched the forums but didn't find anything helpful.
    It's quite easy to get a webcam stream, so there must be a way to get only the audio , too?
    best regards, florian h

    It is possible, but is not easy to setup. Requires Flash
    Media Server or Red5, Also requires setting up Linux codec to
    transcode audio from NellyMoser audio codec to mp3 or setting up
    commercial NellyMoser codec ( price starts at 7,500$).

  • Play flv with Sound object

    How can I play a flv file, stored on my file system
    (C:\Program Files\Macromedia\Flash Media Server
    2\applications\my_app\streams\_definst_\File1.flv) play with the
    Sound object?
    Any help greatly appreciated.

    blurrymurry wrote:
    > your right !
    > thanks flashtard your the tardiest!
    > I thought the variable name was good enough, but forgot
    to include the linkage
    > id in the stop button. so that it would only stop the
    specified sound.
    > So much to learn
    > Hey how does one go about becoming a news group member
    so that other forum
    > users think I'm cool. Is there a point in this or do
    they just get mad at all
    > the newbie questions?
    In regards to News Group users.
    The news server was the very first thing set up almost decade
    ago by macromedia
    for all their products as user-to-user support. Web based
    forum is a very new
    addition and it's not properly synchronized. Many of use
    remain using news server
    because it's much faster to load the messages, there are no
    pages to flip through,
    all the topic and replies follow by the order they appear and
    generally, it's much
    faster to search the forum than using the web based interface
    and lots and
    lots more pros in using that. Not all users however have the
    access to news servers
    so the web based forum is to allow anyone to get help when
    comes to Adobe/Macromedia
    tools.
    If you run programs like Outlook or Thunderbird (like myself
    here) for you emails, you
    can easily add/access the news server by setting up new
    Newsgroup Account.
    The server is forums.macromedia.com , once you there you can
    get list of all the other
    servers and subscribe to any one you need.
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How do I know when a file loaded into a Sound object is invalid?

    I'm writing an app that allows the user to play various sound files.
    Some of these files are mp3, but some may also be ogg, wma, etc.  The selection is out of my control, so I need the sound API to tell me if it can't play something.
    To test, I loaded some test files into a sound object like so:
                    var urlRequest:URLRequest = new URLRequest("http://support.microsoft.com/support/MediaPlayer/wmptest/samples/new/mediaexample.wma");
                    var sound:Sound = new Sound();
                    var soundChannel:SoundChannel = sound.play();
    Even though Flex doesn't play wma's there is no error information or null objects anywhere.  Everthings seems to be fine to flex, I can even register for progress events and see the wma being loaded.
    Just to see how far this goes, I loaded a gif instead of an audio file and the same thing happened.  Progress went fine with no errors of any kind even though I registered for every listed event.  As expected though, no sound played from the gif file.
    What is the recommended way for checking if a file is not playable?

    I'm looking more for an "is it playable" value (since it might be an FLA or FLV as well).
    Even a meaningful length value would work (for some reason duration is set to a value even when loading a gif file - not sure what it means for a GIF to have a length of 96 milliseconds).
    For now I'll have to filter on extension as you mentioned.

  • Apple TV3 and the New iPad - I  WANT to stream the sound only

    Hey guys!
    I've got the new iPad and apple tv 3 which is great together!
    I have a receiver (which is located in the living room)  with Zone2 option and also have outdoor speakers which are connected to that Zone2.
    When I sit outside i want to use my great speaker system and use the outdoor speakers using AirPlay and ATV and stream the content to my ATV but the thing is that when i do that I lose my video on the device and the tv shows my video feed.
    That of course is a problem coz I enjoy my great speakers but can't watch the video (like YouTube video or something else)...
    Is there a way to stream the sound only to the ATV?
    I found discussions of people who don't manage to stream their video to the ATV and only managed to stream their sound but that was an error and things like firmware update solved their problem...
    Found no discussions of people who TRY to stream only the sound, like I want to...
    Does anyone have an idea that can solve my problem?
    Thanks a lot in advance!!!
    Golan

    It's actually very easy and doesn't even require splitting the video stream and extracting the audio track from it (which is pretty easy if you have a desktop computer).
    If you don't want to play back protected content (non-music videos purchased from iTunes Store), all you need to do is getting GoodPlayer, letting it play audio in background (Settings > Background Audio) and connect to your ATV in non-AirPlay mirroring mode. It'll happily play back the audio track of the video while you can do anything in the foreground. (Note that, in addition to GoodPlayer, other background audio-playback players may also work - it's just that I've tested GoodPlayer in this regard between my ATV3 and iPad 3. Let me know if you need more - for example, a list - info on them.)

  • Dynamic Variable Naming for Sound Object

    Is it possible to dynamically name a variable? I'd like to
    create a new Sound Object on the fly, so that I can use the
    Sound.load() method multiple times. I would simply like to create
    and name the variable and add a number to the end of the name
    (i.e.; var "audio_1":Sound). I'm sure that this is possible.
    However, I can't seem to get it figured out.

    This code worked great! However, how can I set a global
    variable equal to the newly created Sound Object so that it is
    available globally via a reuseable reference?
    Here's an example of how I attempted to do this. Please note:
    audioObject is a global variable that I am trying to use to
    reference the new Sound Object in various places.
    audioObjectCount is a global variable that I am using to set
    or get the next number to use when dynamically creating the next
    new Sound Object

  • Out of memmory with Sound object

    Hello,
    I have 2k+ of mp3 files and i need form playlist based on id3 tags. When i create air.Sound object in JS I run load() method and get ID3 tags in COMPLETE event handler. After that i create new Sound object for next file and all looks fine but near 900 file I get Out of memmory error. Whats wrong?
    Before create new object I set old variable value to NULL.

    Below is my basic code. I can convert it into something even more bare if needed. Basically I scan the hard drive for mp3 and AAC's, then pass the file object to this class to get the id3 tags. I've tried deleting sound, setting it to null, but no matter what I seem to have the song sticking in memory. It seems to be about 8MB of RAM for each sound object opened.
    NX.Sound = Class.create(,
         getId3Object: function(file, onComplete){
              var urlRequest = new air.URLRequest(file.url);                    
              var soundLoaderContext = new air.SoundLoaderContext(0, false);     
              var sound = new air.Sound();
              sound.addEventListener(air.Event.ID3, function(e){           
                var id3 = air.Sound(e.currentTarget).id3;
                id3.path = file.url;
                id3.title = id3.TIT2;
                id3.artist = id3.TPE1;
                sound.close();
                      onComplete(id3);
              sound.load(urlRequest, soundLoaderContext);

  • Multiple sounds, One sound object.

    So,
    What I want to do is load in a narrative, based on what a
    person is doing in a game. I create a sound object, load in a sound
    and play it. But, once the user does something, i want to stop that
    sound and start up another sound. I don't want to use
    stopAllSounds() because of sound effects and what not. I made a
    custom function. The way my head tells me this will work is that
    when I cue one sound, it will start playing, and if I cue another
    by calling playSound(), it will destroy the old instance (because
    it is stopping it and clearing it by creating a new sound with the
    same name) and start playing my new sound. What is wrong with my
    logic here?
    function playSound (mySound) {
    narrationSound.stop();
    var narrationSound:Sound = new Sound ();
    narrationSound.attachSound (mySound);
    narrationSound.start ();

    Which option?

  • How remove box showing up around sound object

    hi all - can anyone please tell me how to remove the white box that "houses" my sound object:
    http://www.gratefulcreative.com/portfolio.html
    Thanks one million!
    ken d
    creative director
    grateful creative
    www.gratefulcreative.com

    Hi Larry,
    I didn't think that was a default setting for a spreadsheet built within a table, but apparently it is.
    I'm guessing your experience is similar to mine when I first tried out Numbers after years with Excel. I just didn't get it. It was only after I realized the advantages of working with discrete tables (as opposed to Excel's one big sheet) that things got easier, much easier.
    it looks like with so many people complaining they're starting to add features back in. 
    None of us are privy to what is going on within Apple, of course, but just a general knowledge of the complexities of software engineering and the typical lead times suggests that the major features added back in had to have been planned quite some time ago. It seems more are likely in the works.
    Unfortunately, if you have to work with folks who use Office (on Windows) it's still not a great option.
    This depends on what your work involves. I've had few problems in a Window-centric office. In general, if you have to do a lot of printing of precisely formatted documents, Numbers 3 in its current form is not a great choice.
    But if you're interested in collaborating, the iCloud sharing has gotten pretty decent (in some ways better than the MS offering). Anyone on any OS with a modern browser can take advantage of that.
    And if you want to do data entry in the field on a popular mobile device and have it sync automatically back to a computer, Numbers currently has a big leg up on the competition.
    SG

  • Can the Sound Object control two sounds at once?

    I have a sound object that I want to control two seperate
    sounds in different movie clips..one is intro music which lives on
    the main shell of the website along with the sound object. This
    fades out into a loop that lives on another movie clip that loads
    into the shell on a loadMovie action naturally.
    My goal:
    To control both sound clips with ONE sound object living in
    the main flash site's shell. Can this be done or would I have to
    have two seperate sound objects for each sound clip?
    Thank you,
    Dayton

    You could write a fairly simple class that would act as a
    wrapper for the sound class. In this class you would let it define
    the 2 sound objects but then you would only need to use call to the
    class object to control both. This could also be expanded to
    control more than 2 sounds. It is not exactly what you were hoping
    for but in the long term it would simplify sound control and be
    reusable in pretty much any setting that required sound.
    Tim

  • Preloader and Sound Object

    My Flash site has a media player which uses the attachSound
    method to play and skip through 3 mp3s. As a result the preloader
    shows up after the movie has loaded 60%. To rectify this, i changed
    the Publish Settings under the Flash Tab so that the classes for AS
    2.0 load in the 2nd frame of the Preloader Scene(I have separated
    the preloader and the main movie to diffrerent scenes..)
    I read it somewhere that to correct a similar problem with
    MCs, you need to place them somewhere in the timeline (say,Off
    Stage), But how can same be done for Sound Objects.???

    if i do that then the preloader works fine,however the player
    doesnt work...since the audio files dont get loaded..

Maybe you are looking for

  • Error in generating/deleting the index of the cube in Process chain

    Hi All, I am getting an error in the process chain during the deletion/generation of index in the cube.... error says: " Deleting/reconstructing indexes for InfoCube 0CSAL_C01 is not permitted " Need your input for the same..... Thanks & Regards, Anu

  • Parsing documents in Java called via JNI

    My native application is in C running on WinXP, and I am attempting to call an API in Java using JNI. I am quite a JNI newbie so hopefully someone can shed some light on my issue. Everytime I attempt to parse a document in Java using: DocumentBuilder

  • Converting CHAR or CLOB to BLOB in Oracle9i

    Hi! I want to convert CHAR or CLOB to BLOB. I am working with Oracle9i Database. Oracle9i Supplied PL/SQL Package Release 2 (9.2) does'nt support DBMS_LOB.CONVERTTOBLOB procedure. How I can convert CHAR or CLOB to BLOB in Oracle9i? Valery

  • Widget acts strangely in Safari, but okay in MSIE and Firefox

    This may be asking a lot from iWeb, but I've written a small Javascript calculator widget and inserted it into a page as an HTML snippet. It has several text entry fields. The strange thing that is happening in Safari is that if the cursor is in one

  • How to use tlfx in Flash builder 4.

    Hi, How can i compile the tlfxproject and include it in flash builder 4? I need the table and bullet features, to create an advanced editor. I already have the source for tlfx, but don't know how to proceede. Thanks. Allan