Thanks,
now i understand what you mean. And i know you worked not alone on the standard.
I think no one could do such a standard all alone. And you didn't not write the hole "the mxf book", but a chapter.
There is still one question about the structure of the audiostream. Let me do some calculation for example.
A one frame long stream has 48kHz / 25 = 1920 samples. Each sample has 8 channels, so there are 1920 samples * 8 channels = 15360 datawords.
One dataword is 4 bytes or 32 bits long, including the 24 - 16 bit PCM sample. So the total streamsize should be 61440 bytes. But the audiostream from my one frame long mxf file has a size of 61444 bytes. I dont know why there is a difference of 4 bytes?
And here is the code i wrote.
Code:
for(int i = 0; i < in.length()/32; i++) //streamsize in byte * 8 bit / 8 channels / 32 bits per word
{
for(int j = 1; j <= 8; j++)
{
instream.read(data, 0, 4);
if (j <= NumChannels)
{
short word = Create16BitPCMSample(data);
outstream.write(ShortToByteArray(word));
}
}
}
Code:
private static short Create16BitPCMSample (byte[] data)
{
int buffer = ((0xF0 & data[1]) << 8) | ((0x0F & data[2]) << 8) | (0xF0 & data[2]) | (0x0F & data[3]);
short word = IntToShort(buffer);
return word;
}
Greetings
Sebastian