7 Replies Latest reply on May 22, 2006 5:52 AM by Steve_N

    MP3, AS3 beta 3 and  Mac weirdness

    Steve_N
      I'm looking for some help tracking down the source of a problem that has me baffled.

      I'm learning AS3 on a Mac, compiling with mxmlc via Terminal. I love some of the Spectrum Visualizer demos I have run across and am determined to figure it out. A developer from a local Users Group generously shared his code with me to study.

      I got it working with beta 2 of the SDK, except that it didn't seem to be able to extract the ID3 info. We hoped maybe it was a bug that would be fixed in beta 3 but instead beta 3 made things worse.

      After correcting the syntax changes between beta 2 and 3 the code which worked in beta 2 rendered the visual elements to the stage okay but it refused to play the MP3 resource. I can watch in Safari's Activity window as the data streams in to the browser. The player has a download progress bar, which works and reports that data is loading in the browser. But the music wouldn't play.

      The original author of the code sent me an updated version which works for him (developing on a PC). I copied and pasted, changing nothing but the name of my MP3 file and although it compiled without complaint it didn't play music (on my Mac or his PC). I sent him code which doesn't play for me and it DID when he compiled it on his (Windows PC) system.

      I made a completely minimal swf that doesn't try to do anything fancy at all - just load the resource and play it. Same thing - the data streams to the browser but no music plays.

      At this point I tried substituting a different MP3 file. Suddenly it played! Thinking it was a problem with the first MP3 (even though that MP3 file had worked fine using beta 2), I tried a third. It did NOT play!!! All three of these files have worked in various pre-AS3 Flash mp3 players I have built. All three tracks play in quicktime when addressed directly. I can't for the life of me understand why two out of three MP3 files won't work in Player 9 on a Mac.

      All this background led my more experienced friend to suspect that there might be some aspect of the flex-config.xml file that isn't correct in my environment, but I don't have any idea where to begin looking in that file. I haven't modified the flex-config.xml that came with the beta 3 SDK. I'm not passing any arguments in Terminal other than the path to mxmlc and the ActionScript source file.

      And trying to pull out the id3 artist and songName values STILL doesn't work! If anyone has any pointers as to where to begin looking I sure would be grateful. Thanks.

      Steve
        • 1. Re: MP3, AS3 beta 3 and  Mac weirdness
          Anjali_Bhardwaj Level 1
          Hi Steve,

          An "id3" event is dispatched when id3 information is available. You should add an event listener for id3 event and try to get the values when the listener is called.

          Anjali Bhardwaj
          • 2. Re: MP3, AS3 beta 3 and  Mac weirdness
            Steve_N Level 1
            Anjali;
            Thanks for replying!
            quote:

            You should add an event listener for id3 event

            Yes. I have. It is looking more and more as if the issue lies with the MP3 files. I have tried more MP3s since posting and am now up to 3 that work (two of which also display the ID3 data!) versus 2 that don't. The odds are getting better.

            The two that don't work are tracks I ripped from CDs in iTunes. The three that work came from other sources and I have no idea how those MP3s were created. All 5 of them play in the QuickTime player on my Mac locally and over the internet, so I don't suspect they are corrupted files. The ones that return "undefined" when the ID3 event fires seem to have ID3 info according to iTunes.

            I'm still stumped as to what significantly changed between beta 2 and beta 3 that affects MP3 playback behavior. My first test song played in beta 2 with Flash Player 8.5. Has the Flash Player 9 gotten pickier about what it will play?
            • 3. Re: MP3, AS3 beta 3 and  Mac weirdness
              Anjali_Bhardwaj Level 1

              It is possible that the MP3 file has an id3 1.0 tag while you are trying to access an id3 2.0 tag. Please try accessing both "Sound.id3.songName" and "Sound.id3.TIT2".

              If this does not work, please post the MP3 file somewhere so that we can investigate.

              Anjali Bhardwaj
              Adobe Flex SDK Development Team
              • 4. Re: MP3, AS3 beta 3 and  Mac weirdness
                Steve_N Level 1
                Thank you Anjali. I will try your suggestion. iTunes reports it as a v2.3 ID3 tag but I'll still try your suggestion and tell you what I discover.
                I have compared the files that work and those that don't every way I know how and can't find a difference, but there sure seems to be something different....
                Steve
                • 5. Re: MP3, AS3 beta 3 and  Mac weirdness
                  Steve_N Level 1
                  Hi Anjali;

                  Files for you to study are here:
                  http://www.thegoldenmean.com/temp/BasicPlayer.zip
                  I'll leave them up for a few days but not forever since I don't want to appear to be distributing material protected by copyright. Just so you know, the zip file is about 6.5 megs. Detailed notes are included.

                  Thanks so much for any help you can provide.

                  Steve
                  • 6. Re: MP3, AS3 beta 3 and  Mac weirdness
                    Anjali_Bhardwaj Level 1
                    Hi Steve,

                    Thanks for posting the sample files. You can remove them now.
                    The issue does look like a bug. I'll file a bug on the issue, which hopefully should be fixed in the next release.
                    As a workaround till then, you can open the MP3 file which does not show ID3 in winamp, press "alt + 3" for File-Info dialog, just add a space somewhere and press the update button.

                    Thanks for letting us know of the issue,
                    Anjali Bhardwaj
                    Adobe Flex SDK Development Team
                    • 7. Re: MP3, AS3 beta 3 and  Mac weirdness
                      Steve_N Level 1
                      Anjali;
                      Thank you so much for looking into this! It's a HUGE relief to know that I wasn't *completely* clueless with the coding.
                      :D
                      I work on a Mac so the WinAmp solution isn't going to help me. iTunes is about all I have to encode MP3 with. But as long as I know it's now a known issue I can wait until the next release.

                      Thanks again so much for pursuing this.
                      Steve