I would go for the second frame. I've done some testing with loading MP3's in bytearrays then creating a SWF in a bytearray with the mp3 data. When I use the info from frame 1, 50% of the mp3's play with a wrong samplerate/bitrate. I think this is done by the Xing encoder. When I skip frame 1, all is ok.
Greetz, Bernard -----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens ben gomez farrell Verzonden: woensdag 23 april 2008 3:42 Aan: Flash Coders List Onderwerp: Re: [Flashcoders] Determining sound sample rate? Thanks! That should get me on my way. This, in combination with the last reply about getting raw ID3, should help me out. So thanks to both of ya. ben Juan Pablo Califano wrote: > Hi, as far as I know, the info you're looking for is not in the ID3 tags > (which are not mandatory by the way). > > An mp3 file is a formed by an arbitrary number of "frames", which carry > information about "chunks" of the sound stream; each one contains a header > and the actual audio data. There's no "global" file header, but if you're > looking for the sample rate, I think it's fair to assume that the sample > rate stored in the header of the first frame is the sample rate of the whole > file (that might not be true if you were looking for, say, the bitrate). > > So, I think you can get that data if you read the file directly in binary > format, look for the first frame, and read the bits indicating the sample > rate. > > A good reference for the format spec: > http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html > > And this graphic may help to "visualize" the meaning of each bit in a frame > header: > http://upload.wikimedia.org/wikipedia/commons/0/01/Mp3filestructure.svg > > By the way, if you want to inspect the raw file, you should use an > hexadecimal editor, you won't get far with a text editor. There are many > available, some of them are free, like Hexplorer, which is what I've been > using for a while. > ( you can find it here: http://artemis.wszib.edu.pl/~mdudek/ ) > > I don't know much about the mp3 format specifically, but I have worked a bit > with raw files, so if you want to give it a try and need some help, maybe I > can lend you a hand. > > > Cheers > Juan Pablo Califano > > > 2008/4/21, Steven Sacks <[EMAIL PROTECTED]>: > >> Ben has an open source project on Google code that is the evolution of his >> old classes called Metaphile. >> >> http://code.google.com/p/metaphile/ >> >> _______________________________________________ >> Flashcoders mailing list >> [email protected] >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

