There is no such thing as a "silent" sample. A sample does not contain any "sound," therefore a wrong sample cannot contain either silence or a wrong sound. A sample is a snapshot of an instant in time, and one single sample doesn't tell you what was happening before or after that sample. When a speaker stops moving, you get silence. It doesn't matter where the speaker is, once it stops moving long enough, you hear nothing. A sample only tells you where the speaker cone should be (or your eardrum), not whether it is moving or not. Movement of air means sound, so you have to look at many samples together, in sequence, in order to determine what sound will be heard. For example, if you encode a full-volume sine wave, with a frequency within the human hearing range, then inserting a "zero" sample at the peak of the positive wave will give you a very loud pop. That's not silent at all, even though the one bad sample is 0. At other points in a given waveform, inserting a 0 would make less of a pop. The interesting thing about FLAC is that it is a differential code. Instead of always using 16 bits for each sample, FLAC encodes the difference between the previous sample and the current sample, and then uses the least number of bits to encode the small changes. I have not had any bad FLAC files, but it is possible that reading a bad "sample" would result in 0 difference from the decoder - i.e. you'd get the same sample twice in a row. Repeating the same sample when one is lost would be closer to "silence" than just blindly inserting a 0, because it represents a cessation of movement of air (or your eardrum). However, any bad sample causes distortion of some kind, whether it is loud or quiet depends upon many factors of human perception. But I don't know which result FLAC gives when errors are found and -F is requested. Brian W. On Oct 24, 2007, at 17:35, Harry Sack wrote: I was also wondering if there is a chance the flac decoder outputs a wrong sample containing wrong sound rather then outputting a silent sample or no sample at all. Or is this not possible ? thx in advance
hi thx, exactly the explanation i wanted to hear! i want to try to damage some flac files to hear the effects on the audio, but does anybody knows if there is a program (like hex editor, ...) that could be used to visually 'search' the different blocks in the file, assuming this is even possible. if it's not, what would be a good way to damage the file in some places to be able to hear the effect on the audio? I was also wondering if there is a chance the flac decoder outputs a wrong sample containing wrong sound rather then outputting a silent sample or no sample at all. Or is this not possible ? thx in advance 2007/10/25, Brian Willoughby <brianw@sounds.wa.com>:> If there are tens of thousands of silent samples, due to errors, then > you might hear silence. However, it's more likely to be short enough > to sound like a glitch. In fact, fewer erroneous samples will sound > more like loud distortion than silence, depending upon the difference > between the missing sample and zero. This is all assuming individual > samples. > > What's more likely is that a given error will destroy everything from > the current sample to the end of the block. That's mostly why the > documentation mentions silent sections. If you have a bad FLAC file > and use -F, you'll probably end up with silent blocks. The default > block size for a FLAC file is very similar to the block size of a CD, > so glitches might sound roughly the same. One difference is that > many CD players have digital filters which chirp when there is bad > data, while a FLAC will not have this same sound effect when errors > are detected. > > Brian W. > > > On Oct 24, 2007, at 07:57, Harry Sack wrote: > - the decoded sample is error-free and is added to the WAV file > - the decoded sample has an error but instead this sample is not > added to the WAV file (so it's just thrown away) > - the decoded sample has an error but instead a silent sample is > added to the WAV file (so you can hear in fact silence when there are > a lot of samples of this kind directly after each other) > > is this above correct or are there more situations that can occur in > the case of corrupted flac files you want to decode using -F? > > >
--- Harry Sack <tranzedude@gmail.com> wrote:> i want to try to damage some flac files to hear the effects on the > audio, but does anybody knows if there is a program (like hex editor, > ...) that could be used to visually 'search' the different blocks in > the file, assuming this is even possible. > > if it's not, what would be a good way to damage the file in some > places to be able to hear the effect on the audio?http://www.hydrogenaudio.org/forums/index.php?showtopic=51590 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com