質問

I'm playing with mp3 files and, could not find in the specification whether, except for the bitrate, the characteristics of the frames are allowed to variate. Out of about 17k files I've tested my program on, I've found a few where the layer and channel mode switch mid-stream. Are those corrupt files or is it allowed? It appeared from my tests that sampling rate and frame duration stay constant, but maybe it's just true with the files I tested.

Anyone knows anything about variable characteristics of frames, besides VBR?

Thanks

役に立ちましたか?

解決

Short Version: Either your frame parser is losing sync and reading compressed audio data as a frame header, or you are seeing files that were originally two different MPEG streams that have been concatenated together.

TL;DR: MP3 generally expects frames to be consistent in layer, channel count (notice I didn't say "mode"), & sample rate for any given stream. The spec doesn't say "These must be consistent in the stream" or anything like that, but it does define a decoder that pretty well requires them to stay consistent for proper operation. Other fields can generally change from frame to frame, though only bit rate index and channel mode / sub-mode are likely to change.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top