WAVEFORMATEXTENSIBLE

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

WAVEFORMATEXTENSIBLE

Post by chris319 »

Please include the WAVEFORMATEXTENSIBLE structure:

Code: Select all

The WAVEFORMATEXTENSIBLE structure defines the format of waveform-audio data for formats having more than two channels or higher sample resolutions than allowed by WAVEFORMATEX. It can also be used to define any format that can be defined by WAVEFORMATEX.

Syntax

typedef struct {
  WAVEFORMATEX  Format;
  union {
    WORD  wValidBitsPerSample;
    WORD  wSamplesPerBlock;
    WORD  wReserved;
  } Samples;
  DWORD   dwChannelMask; 
  GUID    SubFormat;
} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: WAVEFORMATEXTENSIBLE

Post by chris319 »

Bumping a five-year-old request.

Please add WAVEFORMATEXTENSIBLE to Windows version, and WAVEFORMATEX and WAVEFORMATEXTENSIBLE to OS X and Linux versions. The wav file structures/headers are not restricted to Windows. Other platforms use them as well.

Also, nChannels, nBlockAlign, wBitsPerSample and cbSize should be unsigned to conform to spec for this structure.

Code: Select all

Structure MYWAVEFORMATEX
  wFormatTag.u
  nChannels.u
  nSamplesPerSec.l
  nAvgBytesPerSec.l
  nBlockAlign.u
  wBitsPerSample.u
  cbSize.u
EndStructure

Structure WAVEFORMATEXTENSIBLE
  format.MYWAVEFORMATEX ;WAVEFORMATEX STRUCTURE
  StructureUnion
    wValidBitsPerSample.u
    wSamplesPerBlock.u
    wReserved.u
  EndStructureUnion
  dwChannelMask.l
  CompilerIf(#PB_Compiler_OS = #PB_OS_Windows)
    SubFormat.GUID
  CompilerElse
    SubFormat.s{16}
  CompilerEndIf
EndStructure
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: WAVEFORMATEXTENSIBLE

Post by chris319 »

Any chance this will ever be implemented?

Please add WAVEFORMATEXTENSIBLE to Windows version, and WAVEFORMATEX and WAVEFORMATEXTENSIBLE to OS X and Linux versions. The wav file structures/headers are not restricted to Windows. Other platforms use them as well.

nChannels, nBlockAlign, wBitsPerSample and cbSize should be unsigned to conform to spec for this structure.

Code: Select all

    Structure MYWAVEFORMATEX
      wFormatTag.u
      nChannels.u
      nSamplesPerSec.l
      nAvgBytesPerSec.l
      nBlockAlign.u
      wBitsPerSample.u
      cbSize.u
    EndStructure

    Structure WAVEFORMATEXTENSIBLE
      format.MYWAVEFORMATEX ;WAVEFORMATEX STRUCTURE
      StructureUnion
        wValidBitsPerSample.u
        wSamplesPerBlock.u
        wReserved.u
      EndStructureUnion
      dwChannelMask.l
      CompilerIf(#PB_Compiler_OS = #PB_OS_Windows)
        SubFormat.GUID
      CompilerElse
        SubFormat.s{16}
      CompilerEndIf
    EndStructure
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: WAVEFORMATEXTENSIBLE

Post by chris319 »

It looks like the WAVEFORMATEXTENSIBLE structure has been added to PureBasic. Thanks to the powers that be.
Post Reply