4 Replies Latest reply on Aug 13, 2010 11:28 AM by Araripina_PE

    How to play mp3 local file?

    Araripina_PE

      I want to play an mp3 in air. I created a folder called src beside the media and placed inside sample.mp3


      I wrote the code below:
      s.load (new URLRequest (song));
      sndChannel s.play = ();


      When the variable "music" is

      music = "sample.mp3" he touches.

      When is the full path does not touch it!

      music = "/ Users/hermes/sample.mp3";

      Error # 2044: Unhandled IOErrorEvent:. text = Error # 2032: Stream Error.
      at playervideo () [/ Users / hermes / Documents / Adobe Flash Builder 4/PlayerVideo/src/PlayerVideo.mxml: 20]
      at _PlayerVideo_mx_managers_SystemManager / create ()
      at mx.managers.systemClasses: ChildManager / initializeTopLevelWindow () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ managers \ systemClasses \ ChildManager.as: 304]
      at mx.managers: SystemManager / initializeTopLevelWindow () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ managers \ SystemManager.as: 2810]
      at mx.managers: SystemManager / http: / / www.adobe.com/2006/flex/mx/internal::kickOff () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ Managers \ SystemManager.as: 2637]
      at mx.managers: SystemManager / http: / / www.adobe.com/2006/flex/mx/internal::preloader_completeHandler () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ Managers \ SystemManager.as: 2539]
      at flash.events:: EventDispatcher / dispatchEventFunction ()
      at flash.events:: EventDispatcher / dispatchEvent ()
      at mx.preloaders:: Preloader / timerHandler () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ preloaders \ Preloader.as: 515]
      at flash.utils:: Timer / _timerDispatch ()
      at flash.utils:: Timer / tick ()


      Why not play? How do I change this directory in the application?
      I want to play songs that are on my computer.