Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Number of Samples (Read 3345 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Number of Samples

Hi, i'm pretty new to all this so i have a question i like to ask. Do mp3 files have the same amount of samples as flac files? Because i opened up the properties of a mp3 file and a flac file in foobar and the number of samples displayed was about the same (10469949 flac vs 10465391 mp3).

Number of Samples

Reply #1
The number of samples is just the sample rate (such as 44100 samples per second) times the length of the file (seconds). If the sample rates are the same and the lengths are the same then the number of samples is the same regardless of which codec was used.

Number of Samples

Reply #2
The number of samples is just the sample rate (such as 44100 samples per second) times the length of the file (seconds). If the sample rates are the same and the lengths are the same then the number of samples is the same regardless of which codec was used.


Not quite. AFAIK, Mp3 stores audio data in blocks of a fixed number of samples, and the audio is padded with zero-samples at the end to make it fit. This is also why mp3 couldn't be used for gapless playback for a long time, because you would almost always get a short click of silence at the end of each file. Some encoders like LAME now add the real length of the file to a special header though to allow gapless playback, and when this is decoded correctly the number of samples should match the original.

Number of Samples

Reply #3
Sample numbers can actually differ either if the mp3 does not contain gapless data or if your player does not take the gapless data into account when displaying sample numbers.

Edit: MedO was faster.

 

Number of Samples

Reply #4
Thanks, i get it now