Windows Media Audio V2 (WAVE_FORMAT_WMAUDIO2 0x161) wrong nBlockAlign
-
Tuesday, June 05, 2012 4:15 PM
Hello i'm trying to cut some audio on wma file from the beginning without reencoding it by removing samples programmatically.
My questions:
1. is it possible to cut encoded audio by nBlockAlign bytes without loosing decoded data of the next sample?
2. are directshow samples dependent on each other in wma?
My tests:
Audio format:
subtype: {00000161-0000-0010-8000-00AA00389B71}
wFormatTag: 353
nChannels: 2
nSamplesPerSec:44100
nAvgBytesPerSec: 16002
nBlockAlign: 5945
wBitsPerSample: 16
decoder specific data:
00 88 00 00 0F 00 00 00 00 00
Directshow Samples are 5945 bytes length ( it's equal to nBlockAlign).
If i have two samples each has 5945 bytes length
WM Audio Decoder DMO gives the following times and data count
start time(ms)/ stop time(ms)/ data size(bytes)
0 58 10240
58 150 16384
150 232 14336
232 278 8192
278 371 16384
371 464 16384
464 510 8192
if i give to decoder only first it gives:
start time(ms)/ stop time(ms)/ data size(bytes)
0 58 10240
58 150 16384
150 232 14336
232 278 8192
if i give to decoder only secondstart time(ms)/ stop time(ms)/ data size(bytes)
46 139 16384
139 185 8192
The difference in decoded data between two samples decoded together and independently decoded is 16384 bytes
Does this mean nBlockAlign is wrong? And how this value can be calculated?
Stanislav Mikhailenko
- Edited by Stanislav Mi Tuesday, June 05, 2012 4:17 PM


