I want to write silence/zeroed audio sampled data into mov
media container file inside audio data. My audio data is G711 linear PCM-mulaw encoded data with one channel. Currently my code looks like:
AVFrame* pSilentData = av_frame_alloc();
memset(&pSilentData->data[0], 0, iDataSize);
pkt.data = (uint8_t*) pSilentData;
pkt.size = iDataSize;
// ...
av_freep(&pSilentData->data[0]);
av_frame_free(&pSilentData);
But this sounds noise like dot dot instead of silence. What's the problem?
For ยต-law audio the zero value is represented as
0xff
, so change:to: