2
votes

Is there a defined format tag for Opus that should be used with the WAVEFORMATEX structure? See WAVEFORMATEX structure, wFormatTag.

2

2 Answers

1
votes

Windows SDK defines WAVE_FORMAT_OPUS (0x704F == 'Op') and MFAudioFormat_Opus which is a Media Foundation equivalent for supposed MEDIASUBTYPE_OPUS, and is a standard FourCC based mapping from WAVE_FORMAT_OPUS.

That is, those are suggested for use identifiers.

However though, Microsoft's own implementation of Opus decoder is not available to public and reserved for use in Microsoft's products (presumably Edge browser), so there is no adopted practice and even documentation more on these identifiers, and everyone on his own how to use them (or use something else instead).

0
votes

Until there is a formal format tag for Opus, I will use WAVE_FORMAT_EXTENSIBLE instead, using MEDIASUBTYPE_OPUS for the SubFormat parameter.

#define WAVE_FORMAT_OPUS      mmioFOURCC('O','P','U','S')
DEFINE_GUID(MEDIASUBTYPE_OPUS,
  WAVE_FORMAT_OPUS, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);

WAVEFORMATEXTENSIBLE allows you to avoid having to register a new format tag with Microsoft.

See MMReg.h in Windows SDK