AS3 mp3 streaming anomaly

Hey there,
I am trying to stream an mp3 file using the following code buy am getting no luck:
var s:Sound = new Sound();
var req:URLRequest = new URLRequest("track01.mp3");
var trans:SoundTransform = new SoundTransform(0.3);
var context:SoundLoaderContext = new SoundLoaderContext(8000, true);
s.load(req, context);
s.play(0, 20,trans);
When I export the file from flash, it doesn't play the audio. When I view it in HTML, it doesn't play the audio. But when I open the swf file DIRECTLY using flash player - the audio plays!
Any ideas on where the problem lies?
NOTE: I am using swfObject 2.2 when embedding it in the HTML.

NetConnection has not been established. You need to
addEventListener.
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS,
function(e:NetStatusEvent) {
if (e.info.code == 'NetConnection.Connect.Success') {
ns = new NetStream(nc);
ns.play("songs");

Similar Messages

  • Adobe air for Playbook & mp3 streaming

    I want to listen radio-canada streaming (Mp3).
    I coulndt find an apps to play streaming MP3 ( where I can paste the radio canada link)
    So I decide to install the widget, which need adobe air..
    I'm unable to acces adobe air download from the browser and the widget doesn't want to install
    Look like a pandora box....
    So, the question is...Is there any way to play mp3 streaming via the playbook or to install widget with adobe air?
    Thanks

    Have you tried the Nobex Radio app on the PlayBook?
    Maybe this has the station that you're trying to listen to.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!

  • AS3 MP3 Player

    Just sharing some ActionScript 3 source code for those
    Interested. Instrctions and source FLA, as files are the link
    below. Its an mp3 player, with play, pause, stop, next song,
    previous song, id3 info display and uses computeSpectrum
    AS3
    MP3 Player Link
    Eddie
    Truth Realization
    DHTML Nirvana

    Just sharing some ActionScript 3 source code for those
    Interested. Instrctions and source FLA, as files are the link
    below. Its an mp3 player, with play, pause, stop, next song,
    previous song, id3 info display and uses computeSpectrum
    AS3
    MP3 Player Link
    Eddie
    Truth Realization
    DHTML Nirvana

  • How to play a regular mp3 stream on iPhone ?

    such as an mp3 stream from:  http://91.121.24.85:80/cybele.mp3
    This can be easily played on iTunes on the computer. But how do we play it from the iPhone directly without using a computer ?

    Clicking directly on the link you posted in Safari worked fine for me.
    For apps just type "stream mp3" into the search box in the AppStore.

  • Playing mp3 stream works well in Emulator but doesn't play on Device

    I'm facing this problem. I'm using flex && actionscript to play an mp3 stream on the phone.
    Code works great and the sound is played when the app is run in the flash builder emulator.
    However, when i deploy my app on a mobile device (tried several Android phones) everything is good except the stream doesn't play!
    Can you please help me??
    Here's my code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView"
                        creationComplete="view1_creationCompleteHandler(event)"
                        >
              <fx:Script>
                        <![CDATA[
                                  import mx.events.FlexEvent;
                                  import flash.net.*;
                                  import flash.media.*;
                                  private  var req:URLRequest;
                                  private  var context:SoundLoaderContext = new SoundLoaderContext(8000, true);
                                  private   var s:Sound;
                                  private  var channel:SoundChannel = new SoundChannel();
                                  private  function AudioOn():void
                                            req = new URLRequest("http://stream2.srr.ro:8000/;stream.mp3");
                                            s = new Sound(req,context);
                                            channel=s.play();
                                  protected function view1_creationCompleteHandler(event:FlexEvent):void
                                            AudioOn();
                        ]]>
              </fx:Script>
              <fx:Declarations>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>
    </s:View>

    Okay.. First a big thanks!!
    I've resolved the path issues and am now experimenting with formats other than SCORM that will hopefully launch off our LMS (SyberWorks).
    I think I know what a cross domain issue is... it seems pretty self evident, (ie) .htm/.swf files live on a different server domain than video or audio files.
    I think all my files are on the same domain in the zip file. However, are the following paths also an example of a cross domain issue?:
    Z:\orgs\ogslp\courses\2012videotest\videotestinternalsrvr\videotestinternalsrvr.htm
    (this is where I upload, or publish Captivate files)
    http://gslcampus/ogslp/courses/2012videotest/videotestinternalsrvr/videotestinternalsrvr.h tm
    (this is where clients access the training modules via IE & the Syberworks LMS, intranet)
    One more..... when publishing with the Captivate > Internal Server option what path do I input to access the server?
    Z:\orgs\ogslp\courses\2012videotest\videotestinternalsrvr\videotestinternalsrvr.htm
    (backdoor for uploading files)
    or
    http://gslcampus/ogslp/courses/2012videotest/videotestinternalsrvr/videotestinternalsrvr.h tm
    (actual internal, intranet url for accessing courses)
    PS when I upload files the following appears before the Z:
    Computer > SyberWorks (\\sousa)(Z:)
    Any advice would be appreciated - thanks for your time.
    wjf

  • Why does BackgroundMediaPlayer NOT play mp3 streams?

    I tried to make a universal app, I have a successful Win8 app, now I have tried to make a WinPhone version and find that this class can't play mp3 streams, for example
    http://europaplus.hostingradio.ru:8014/europaplus256.mp3

    Hello,
    There is no standard mp3 streaming protocol. Some sites use pseudo streaming by throttling a standard progressive download of mp3 data. While pseudo streaming may work on some Microsoft platforms is not officially supported by the Media Engine out of
    the box. A major problem with pseudo streams is their interaction with the internet cache. It is possible to overload the cache with extended listening sessions and eventually use up all the storage on the device. This is the big reason
    pseudo streaming is not supported.
    I would recommend that you check with the stream provider and ask them what streaming protocol they are using. If they are simply using HTTP with no underlying streaming protocol such as HLS or DASH then they are using pseudo streaming and you may have
    problems with playback on the current and future Microsoft platforms.  
    If you know that the stream provider's content is consistent (or you are the content provider) one possible solution is to write a custom
    MediaStremSource that will handle the network interactions, local cacheing and packet parsing. You can then pass the parsed samples down stream to the Media Engine for decoding and playback.
    The best solution however is to convince the content provider to switch to a real streaming protocol or offer a separate URL that supports a true streaming protocol. To future proof any new streaming implementation I always recommend MPEG DASH.
    I hope this helps,
    James
    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

  • Not able to download mp3 streams into iTunes like it used to.

    I am using iTunes v.2.0.3 on my Powerbook G3 with Internet Explorer 5.1.7 for a browser. I use iTunes to listen to mp3 radio streams w/o any problems until I downloaded Windows Media Player 7.1 for Mac & iCab 3.0 as a backup web browser. Now, I am not able to download any new mp3 streams. The radio tuner feature & the streams that I had saved in the library still work. I had tried to click on the "listen" button from several streaming sources, but the webpage stays the same, not even the download manager window opens to show it's downloading the stream & activates the iTunes application.
    My guess is that the 2 software downloads may have conflicted or change the settings somewhere & I do not know where to look to change them back to what it was previously. I would like to use both players if at all possible, but am not computer savvy to accomplish that yet. Any suggestions from those knowledgable in OS9 and/or iTunes would be appreciated to achieve that goal.
    Thanks
    highwaydog

    The more details you can provide the esier it will be for us to help you.
    Is this the CD by Goyte?  I see no reference of any kind online to it being protected and usually it be be one of the first things people would mention. Not many CDs have protection since this resulted in a very bad name when Sony tried it a while back. This is the original, store (or online) purchased plain audio CD?  If it is of some other type such as something with original WMA files then those could quite well be from protected downloads which cannot be legally converted.  Nor can they be played on a Mac (I don't think Flip4Mac plays protected WMA).

  • AVAudioPlayer MP3 stream problems

    I am having problems getting an mp3 stream to work with AVAudioPlayer in 2.2. I built a simple app just to get streaming working with a .pls file. I am parsing the file perfectly fine in my player app, but for this simple test app I just grabbed one of the urls from the .pls file and use it directly. The problem I am running into is it is failing with a kAudioFileUnsupportedFileTypeError. In my sample code I use a hosted MP3 file as a control. it works perfectly fine.
    Is the problem that NSURLConnection is expecting a Content-Length field in the response? The stream won't return one because there is no end to the stream. If this is the problem what do you recommend for connecting to an audio data stream?
    I don't want to use the complex AudioQueue way of doing it. Here is the output of my program when running with an mp3 stream.
    2008-11-30 17:21:54.377 radiotest[27239:20b] Starting the song
    2008-11-30 17:21:54.382 radiotest[27239:20b] Operation could not be completed. (OSStatus error 1954115647.)
    2008-11-30 17:21:54.386 radiotest[27239:20b] song type failed
    2008-11-30 17:21:54.460 radiotest[27239:20b] Appending data - 215222
    2008-11-30 17:21:54.461 radiotest[27239:20b] Starting the song
    2008-11-30 17:21:54.467 radiotest[27239:20b] Operation could not be completed. (OSStatus error 1954115647.)
    Also, AVAudioPlayer initWithContentsOfURL:(NSURL*)url error:(NSError **)error throws a warning because it is conflicting with it's super's implementation of initWithContentsOfURL. Upon calling it, it fails every time. I am forced to use the initWithData method. Is this a known issue?
    I don't know what the html code is to format my code properly, sorry. Here is my code.
    Header file:
    // radiotestAppDelegate.h
    // radiotest
    #import <UIKit/UIKit.h>
    #import <AVFoundation/AVFoundation.h>
    @interface radiotestAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    UINavigationController *navigationController;
    AVAudioPlayer *player;
    NSMutableData *songData;
    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
    @property (nonatomic, retain) AVAudioPlayer *player;
    @property (nonatomic, retain) NSMutableData *songData;
    - (void) startPlaying;
    @end
    Here is the implementation file:
    // radiotestAppDelegate.m
    // radiotest
    #import "radiotestAppDelegate.h"
    #import "RootViewController.h"
    #import <AudioToolbox/AudioFile.h>
    @implementation radiotestAppDelegate
    @synthesize window;
    @synthesize navigationController;
    @synthesize player, songData;
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Configure and show the window
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    // -- build the request
    NSLog(@"Starting call");
    //NSURL *url = [NSURL URLWithString:@"http://www.toolshed-media.com/ts/jenny-lewis-acid-tongue.mp3"];
    NSURL *url = [NSURL URLWithString:@"http://208.80.52.58:80/WPEGFMDIALUPCMP3"];
    NSURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
    NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
    if (theConnection)
    songData=[[NSMutableData data] retain];
    - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
    [songData setLength:0];
    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    [songData appendData:data];
    NSLog([NSString stringWithFormat:@"Appending data - %d", [songData length]]);
    if(player.isPlaying == NO && [songData length] > 100000)
    NSLog(@"Starting the song");
    [self startPlaying];
    - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
    [connection release];
    [songData release];
    NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);
    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
    NSLog(@"Succeeded! Received %d bytes of data",[songData length]);
    [connection release];
    [songData release];
    - (void) startPlaying
    NSError *error;
    AVAudioPlayer *av = [[AVAudioPlayer alloc] initWithData:songData error:&error];
    NSLog([error localizedDescription]);
    NSLog([error localizedFailureReason]);
    if(error.code == kAudioFileUnsupportedFileTypeError)
    NSLog(@"song type failed");
    player = av;
    [player play];
    - (void)dealloc {
    [songData release];
    [player release];
    [navigationController release];
    [window release];
    [super dealloc];
    @end

    This sample project: http://www.zdziarski.com/AVMeter.zip includes use of AVAudioPlayer with local files. The lines to look for are like these:
    NSURL *tickURL = [NSURL fileURLWithPath:[mainBundle pathForResource:@"tick" ofType:@"caf"]];
    tickPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:tickURL error:&error];
    To play an mp3 in your resources you would change @"tick" to contain the name of the file (without the extension), and change the ofType:@"caf" to be ofType:@"mp3".

  • [WP8.1] MediaElement mp3 streaming not working

    Hi everybody,
    I was trying to update my app from a Windows Phone 8 to a Windows Universal app and I can't manage to get the MediaElement to work on the WP version
    This is the source of the MP3 streaming
    player.Source = new Uri("http://stream.srg-ssr.ch/m/rsp/mp3_128");
    but when I try playing it I the player closes and I get back the MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED although this is an mp3 file... Does somebody know hot to solve this?
    Thanks
    Nahuel Guidotti

    Hello Nahuel,
    You need to contact the content provider and find out what streaming protocol they are supporting. Out of the box we only support Microsoft proprietary streaming protocols. If the content provider supports a protocol such as HSL you will need to find a 3rd
    party
    MediaStreamSource that supports the protocol that the content provider is using.
    I hope this helps,
    James
    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

  • JMF and MP3 streaming

    Hi,
    I tried to write an JMF Plugin for an MP3 audio stream. The plugin should buffer the compressed MP3 data, but
    extending the AVReceive2.java with a plugin did not send any output to the player.
    Would someone please help me with a code snapshot?
    Any better ideas than using a plugin for MP3 stream buffering?
    Thanks in advance,
         Florian

    hope this help this is a code i found in a search on this forum hope it helps
    //: SimplePlayer.java
    // This is a simple JMF Program that will play any support audio
    import java.io.*;
    import java.net.*;
    import javax.media.*;
    public class SimplePlayer {
    private static Player player;
    private File file;
    private URL url;
    private String filename;
    public SimplePlayer(String filename) {
    this.filename = filename;
    initalizePlayer(filename);
    private void initalizePlayer(String filename) {
    try {
    file = new File(filename);
    this.filename = file.getName();
    url = file.toURL();
    System.out.println("Initalizing Player ...");
    player = Manager.createPlayer(url);
    System.out.println("Player Initalized ...");
    catch (Exception e) {
    e.printStackTrace();
    public static void main(String args[]) {
    if(args.length == 0) {
    System.out.println("Usage: java SimplePlayer [filename] \n\n" +
    "Example: \n" +
    "\tWindows - java SimplePlayer c:\\mp3\\GoodSong.mp3 \n" +
    "\tUnix - java SimplePlayer \\usr\\mp3\\GoodSong.mp3");
    else
    /* This for loop concatenates the input
    string received at the command line.
    If the command line input has spaces
    java will parse by the spaces.
    For example: java SimplePlayer c:\My
    Music Directory\Very Good Song.mp3
    Before for loop:
    args[0] = "c:\My"
    args[1] = "Music"
    args[2]
    = "Directory\Very"
    args[3] = "Good"
    args[4] = "Song.mp3"
    After for loop:
    args[0] = "c:\My Music
    Directory\Very Good Song.mp3"
    for(int i = 1; args.length > i; i++) {
    args[0] += " " + args[ i ];
    SimplePlayer sp = new SimplePlayer(args
    [0]);
    String input;
    try {
    BufferedReader in = new
    BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter Command: ");
    while(!(input = in.readLine
    ()).equals("quit")) {
    if(input.toLowerCase
    ().equals("play")) {
    System.out.println("Playing " + sp.filename + "...");
    player.start();
    else if(input.toLowerCase
    ().equals("stop")) {
    System.out.println("Stopping " + sp.filename + "...");
    player.stop();
    else {
    System.out.println("Invalid Command...");
    System.out.println("Enter Command: ");
    catch (Exception e) {
    e.printStackTrace();
    finally {
    System.out.println("Closing Player");
    player.stop();
    player.close();
    System.exit(0);

  • JMF an MP3 streaming

    Hi,
    I tried to write an JMF Plugin for an MP3 audio stream. The plugin should buffer the compressed MP3 data, but
    extending the AVReceive2.java with a plugin did not send any output to the player.
    Would someone please help me with a code snapshot?
    Any better ideas than using a plugin for MP3 stream buffering?
    Thanks in advance,
         Florian

    Hi all,
    the problem in detail:
    The plugin is not accepted as a pre-precessing plugin. JMF tries to konvert the source MP3 stream in an new MP3 stream!
    Could someone please help?
    Florian

  • How to read metadata (such as artist  trackname) from mp3 stream properly?

    Hi,
    while playing with JavaFX i would like to read metadata from a mp3 stream ( internet radio)
    to display information such as author, artist , trackname..
    Anbody could give some code example to show how to achieve that?
    Any help would be appreciated..
    Thank you,
    Lacos

    Thank you for your help. I tried once more but somehow i don't get it.
    Here's my code:
    binding the JavaFX media player to variable "player"..
    var player =
         MediaPlayer {
           repeatCount:MediaPlayer.REPEAT_FOREVER
            media : Media {source:mp3RadioStream}
    starting playing the stream when user clicks in a rectangle area
    and (hopefully ever printing some metadata :-) ..
    Rectangle {
                  opacity: 0.0
                  x: 10 y: 80 width: 128 height: 126
                   onMouseClicked: function(e:MouseEvent):Void
                        println("mouse clicked ..");
                        println("setting radio stream..");
                        player.media = Media {source: mp3RadioStream};
                        println("play init..");
                        player.play();
                        println("playing..");
                        // printing some metadata
                         for (a in player.media.metadata) {
                            println("metadata key: {a.key} , value: {a.value}");
                   }Any help, especially some explicit code example would be very appreciated..
    It has to be a silly error on my side but i really dont get it :-/
    Tried to play the mp3 stream with winamp an the stream definitly has some metadata like
    artist , trackname..
    Thx for your help,
    Lacos

  • Read MP3 tags from HTTP mp3 streaming

    Hi , how i can read MP3 tags from HTTP mp3 streaming (streaming url : http://94.25.53.133:80/nashe-9)
    Regards
    Alex

    Hi , how i can read MP3 tags from HTTP mp3 streaming (streaming url : http://94.25.53.133:80/nashe-9)
    Regards
    Alex

  • Moc won't play mp3 streams?

    I use MOC (mocp) as my audio player and have for years. I just switched over to Arch and can't get it to play MP3 streams. I have the following installed:
    moc-svn (from the AUR; debug enabled)
    version info:
    moc 2.5.0-alpha4 Build: Mar 13 2011 10:55:01
    Compiled with: OSS ALSA JACK DEBUG internet streams resample
    ffmpeg-git
    lame (normal repo)
    curl (normal repo)
    I can play the same stream using ffplay directly, but it was my thought that moc uses lame to decode MP3 and a combo of curl and lame for MP3 streams? Playing a local MP3 file works fine. However, when I load my playlist and select a stream it just sits at "connecting..." for ever. Debug mode shows no errors on the console. I'm running the same version of moc on my Ubuntu laptop and FreeBSD server, so I know it can play streams.
    Thoughts?

    #I´m using  moc-1:2.5beta1-5 from actual repository with kernel 3.10.12-1-MANJARO and i #can´t play streams like pls or m3u,
    #but it´s cause moc can not unpack m3u or pls, .. to it´s playlist. So i can do:
    [diamond@diamond ~]$ wget http://somafm.com/secretagent.pls
    --2013-09-24 12:06:47--  http://somafm.com/secretagent.pls
    Překládám somafm.com (somafm.com)… 74.217.192.202
    Navazuje se spojení s somafm.com (somafm.com)|74.217.192.202|:80… spojeno.
    HTTP požadavek odeslán, program čeká na odpověď… 200 OK
    Délka: 572 [audio/x-scpls]
    Ukládám do: „secretagent.pls“
    100%[========================================================================================================================================================================================================================================>] 572         --.-K/s   za 0s     
    2013-09-24 12:06:48 (14,0 MB/s) – „secretagent.pls“ uloženo [572/572]
    #then
    [diamond@diamond ~]$ cat secretagent.pls
    [playlist]
    numberofentries=3
    File1=http://mp3.somafm.com:443
    Title1=SomaFM: Secret Agent (#1 128k mp3): The soundtrack for your stylish, mysterious, dangerous life. For Spies and PIs too!
    Length1=-1
    File2=http://mp2.somafm.com:9016
    Title2=SomaFM: Secret Agent (#2 128k mp3): The soundtrack for your stylish, mysterious, dangerous life. For Spies and PIs too!
    Length2=-1
    File3=http://ice.somafm.com/secretagent
    Title3=SomaFM: Secret Agent (Firewall-friendly 128k mp3) The soundtrack for your stylish, mysterious, dangerous life. For Spies and PIs too!
    Length3=-1
    Version=2
    [diamond@diamond ~]$
    #And then i can add stream in to the local playlist for example from line starts File1=.. on the #start of wget processing
    #It´s in my case: http://mp3.somafm.com:443
    #Or do:
    [diamond@diamond ~]$ mocp http://mp3.somafm.com:443
    #And moc sudenly play nicely :)
    Last edited by Synnema (2013-09-24 11:14:11)

  • Adding art to an mp3 stream

    why doesn't itunes allow art to be added to an mp3 stream? are there any applescripts or shareware that fix this?

    i can put artwork on songs, but itunes doesn't allow artwork to be added to radio streams. try it. after you go into the information box on a stream the lyrics tab and artwork tab are not highlighted.

Maybe you are looking for

  • Could not find installation information for this machine contact applecare

    I installed Lion on my MacBook, worked great. After 2 months I wanted to clean install the Lion on the same Macbook; went to Apple Support website and there they had instructions on how to clean install Lion. I followed the instructions and erased th

  • ITunes 7.3.2.6: Vista: Error Msg: iTunes has stopped working

    I have installed the newest version of iTunes on my Windows Vista computer, and I've had no trouble with the program after the original installation. I then ran across a spyware problem (not due to iTunes) and had to run System Restore in order to cl

  • Base class vs derived class

    We have entity classes that we use to access our database. We have subclasses derived from these entity classes that apply business rules. For instance, the base class AddressEntity has a setAddress2(string) that AddressEntity.select() uses to set a

  • Excel Functions

    I was under the impression that after a user did a "save as" on a BEX workbook they could then use the spreadheet as normal in Excel. But I can't seem to get the "Sort" menu item to become active . Its grayed out. Will reward points for any help Rich

  • My computer is going to a white screen when I turn it on. I have tried repairing it from my recovery drive and it says that my disk is ok.

    My MacBook Pro (2010) has Mavericks operating system. The other day I was working in pages and all of the sudden it notified me that auto save wasn't working anymore. So I restarted my computer and it went to this white screen. I've opened up my reco