Mark A. Richman wrote:
> I'm actuallly having more trouble with the array
> definitions. For example, I have tried declaring the
> bitrates array two ways:
> int[,,] bitrates = new int[4,4,16] and
> int[][][] bitrates = new int[4][4][16]
> neither of which are working too well. I can paste the
> whole block of code if you like.
This is a jagged array:
/// [4 /* version */][4 /* layer */][16 /* bitrate */]
private static readonly int[][][] bitrates = {
new int[][] { /* V2.5 */
/* L0 */ new int[] { 0, },
/* L3 */ new int[] { 0, },
/* L2 */ new int[] { 0, },
/* L1 */ new int[] { 0, },
},
new int[][] { /* V0.0 */
/* L0 */ new int[] { 0, },
/* L3 */ new int[] { 0, },
/* L2 */ new int[] { 0, },
/* L1 */ new int[] { 0, },
},
new int[][] { /* V2.0 */
/* L0 */ new int[] { 0, },
/* L3 */ new int[] { 0, },
/* L2 */ new int[] { 0, },
/* L1 */ new int[] { 0, },
},
new int[][] { /* V1.0 */
/* L0 */ new int[] { 0, },
/* L3 */ new int[] { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1, },
/* L2 */ new int[] { 0, },
/* L1 */ new int[] { 0, },
},
};
However, this is necessary only because the table is incomplete and I used an abbreviated syntax. If you fill in the whole table (look at the articles I gave you the links to in the second reference), the array won't be jagged anymore and you can more easily initialize it:
/// [4 /* version */][4 /* layer */][16 /* bitrate */]
private static readonly int[,,] bitrates = {
{ /* V2.5 */
/* L0 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L3 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L2 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L1 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
},
{ /* V0.0 */
/* L0 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L3 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L2 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L1 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
},
{ /* V2.0 */
/* L0 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L3 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L2 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L1 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
},
{ /* V1.0 */
/* L0 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L3 */ { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1, },
/* L2 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
/* L1 */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, },
},
};
> Aside from the TAG block at the end of the MP3 file, I
> also see lots of header data. Do I need to alter/cut that
> out too when concatenating two streams?
What do you mean?
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net