riff: Factor out WAVEFORMATEX parsing