Core audio: is zero equivalent to silence for PCM audio only?

I am trying to create a basic algorithm that hides packet loss for the main sound. I just want to replace the missing data with silence. In a book devoted to the study of basic sound, the author says that in lossless PCM, zeros mean silence. I was wondering if I would play VBR (i.e. Compressed data), would zeros add zero for silence?

In my existing code .. when I connect zeros in the audio queue .. it suddenly gets stuck (i.e. it no longer frees the consumed data in the audio queue callback ..), and I wonder why

+7
source share
1 answer

PCM is a raw coded sample. All 0 (when using signed data for samples) is really silence. (In fact, any value is silence, but such a DC bias can damage your amplifier and / or speakers if it is not filtered.)

When you compress a lossy codec, you enter a digital format where it’s not trivial to just add silence. Consider adding data to a zip file to add null bytes to the end of the file. It is not as simple as simply embedding them arbitrarily in a ZIP file.

If you want to add silence to a compressed file, you must do this using the appropriate codec. Then you should put it in a bit stream, which is also not trivial. Usually a stream is split into frames, but you cannot even split these frames in some formats. MP3 and AAC use a bit-tank, in which unused data in previous frames can be used for subsequent encoding of more complex frames, which makes it difficult to split the file.

+3
source

All Articles