I am currently developing an application to work with WAV files. I want to be able to display the information in the struct with its native type, but C# thinks of char as a 16 bit value.
The four bytes ChunkID0…3 are supposed to contain ‘R’ ‘I’ ‘F’ ‘F’
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 1)]
public unsafe struct RiffDescriptor
{
[FieldOffset(0)]
public byte ChunkID_0;
[FieldOffset(1)]
public byte ChunkID_1;
...
}
I want the debugger to show the ChunkID as ‘R’ instead of 122.
Any thoughts?
1 Answer