No, I've not tried to do the AS example without Flex involved.
It looks like the problem is not coming from flex but from the MP3 files or
a buggy MP3 support in the 8.5 player.
With some MP3 files, it works, with others it doesn't...
But the MP3 files have been encoded directly from a CD with iTunes, so I
don't understand.

I've put online a (pretty buggy and unfinished) Flex2 audio player here
(with view source option) :
http://www.benorama.com/music/AudioPlayer.html

You can try different uploaded MP3s :
- AdamF.mp3 (encoded with iTunes), the song plays but the sound is cut all
the time, ID3 are not detected, when the load is complete, it stops the song
(channel soundComplete event mixed with sound load complete event?)...
- Unknown.mp3, this one works (no ID3 on this one),
- Herbaliser.mp3, this one does not play at all (immediate channel
soundComplete event), ID3 are loaded at the end of the load,
- CYHSY.mp3 (encoded with iTunes), this one does not play at all (immediate
channel soundComplete event), ID3 are not detected.

I can play all those songs with iTunes or Window Media Player without any
problem.

Other bugs :
- the pause does not work, it looks like sound.play(position) does not take
the "position" argument into account,
- when using the audio player inside another app, the loading/play progress
does not work at all.
The load progress bytesTotal does not have a fix value, it is growing all
the time...

Has anyone successfully built a MP3 audio player with Flex2 beta1?

This week, next step: a FLV video player... ;)

Benoit Hediard

-----Message d'origine-----
De : [email protected] [mailto:[EMAIL PROTECTED] De la
part de Matt Chotin
Envoyé : dimanche 12 mars 2006 22:17
À : [email protected]
Objet : RE: [flexcoders] Flex2 : MP3 Audio player, play problem...

Have you tried doing the AS example without Flex involved?  Based on
everything I can see I think it looks OK.  

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Benoit Hediard
Sent: Friday, March 10, 2006 11:51 AM
To: [email protected]
Subject: [flexcoders] Flex2 : MP3 Audio player, play problem...

I'm currently trying to build a very basic MP3 audio player with Flex2,
based on the SoundChannel code example.
The MP3 file is successfully loaded, ID3 tags are available, length is > 0.
But when I press play I've got immediatly the soundComplete event.
What's wrong here?

I've tried with several MP3, same problem...

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml";
        creationComplete="onCreationComplete()">
        
        <mx:Script>
                <![CDATA[
                        import flash.util.trace;
                    import flash.util.Timer;
                     import flash.net.URLRequest;
                    import flash.media.Sound;
                    import flash.media.SoundChannel;
                    import flash.events.*;
                    
                    private var soundUrl:String =
"http://localhost/test.mp3";;
                private var soundFactory:Sound;
                private var channel:SoundChannel;
                private var positionTimer:Timer;
                
                private function onCreationComplete():void {
                        var request:URLRequest = new
URLRequest(soundUrl);
                    soundFactory = new Sound();
                    soundFactory.addEventListener(Event.COMPLETE,
completeHandler);
                    soundFactory.addEventListener(Event.ID3,
id3Handler);
                    soundFactory.addEventListener(IOErrorEvent.IO_ERROR,
ioErrorHandler);
        
soundFactory.addEventListener(ProgressEvent.PROGRESS,
progressHandler);
                    soundFactory.load(request);
                }
                
                private function
positionTimerHandler(event:TimerEvent):void
{
                    //trace("positionTimerHandler: " + channel.position);
                }
        
                private function completeHandler(event:Event):void {
                    trace("completeHandler: " + event);
                    playButton.enabled = true;
                }
        
                private function id3Handler(event:Event):void {
                    trace("id3Handler: " + event);
                }
        
                private function ioErrorHandler(event:Event):void {
                    trace("ioErrorHandler: " + event);
                }
        
                private function
progressHandler(event:ProgressEvent):void {
                    trace("progressHandler: " + event);
                }
        
                private function soundCompleteHandler(event:Event):void
{
                    trace("soundCompleteHandler: " + event);
                        positionTimer.stop();
                }
                
                private function onPlayClick():void {
                        channel = soundFactory.play();
                    channel.addEventListener(Event.SOUND_COMPLETE,
soundCompleteHandler);
        
                    positionTimer = new Timer(50);
                    positionTimer.addEventListener(TimerEvent.TIMER,
positionTimerHandler);
                        positionTimer.start();
                }
                ]]>
        </mx:Script>
        
        <mx:Button id="playButton"
                click="onPlayClick()"
                enabled="false"
                label="Play" />
        
</mx:Application>

Benoit Hediard




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to