Thursday, February 19, 2009

Integer division by error with Audio Decoder filter

while delivering audio data, I got a problem as follows:

i) if I deliver it then I got a crash in Decoder as "Integer division by zero".

So I modified the AvgBytesPerSec member of WAVEFORMATEX structure as follows:


wfx.nBlockAlign = 1 ;
wfx.nAvgBytesPerSec = MP3hdr->bitrate * 1000 / 8;

Solution:
--------------
Assign the proper values for WAVEFORMATEX header.

Modified value as follows Now the Filter is working fine.

wfx.nBlockAlign = 2 * nchannels ;
wfx.nAvgBytesPerSec = pwfxout->wfx.nSamplesPerSec * pwfxout->wfx.nBlockAlign ;

No comments: