none
WAVEFORMATEXTENSIBLE and format.nChannels := 1;

    Dotaz

  • Hello,

    i need (want) to put audio stream to only specified single audio channel in 7.1 soundcard. It would be great if it is possible to do with WAVEFORMATEXTENSIBLE structure and nChannels set to 1 and ChannelMask set to specified channel.
    I try to do following (in delphi):

    format.wFormatTag := WAVE_FORMAT_EXTENSIBLE;
    format.nChannels := 1;
    format.nSamplesPerSec := 8000;
    format.wBitsPerSample := 16;
    format.nBlockAlign := round (wf71.WFx.wBitsPerSample / 8 * wf71.WFx.nChannels);
    format.nAvgBytesPerSec := wf71.WFx.nSamplesPerSec * wf71.WFx.nBlockAlign;
    format.cbSize := sizeof(TWAVEFORMATEXTENSIBLE) - sizeof(TWAVEFORMATEX);
    ValidBitsPerSample := 16;
    ChannelMask := SPEAKER_FRONT_CENTER;
    SubFormat := KSDATAFORMAT_SUBTYPE_PCM;/

    In case when i set nChannels to 1 and ChannelMask to something else as SPEAKER_FRONT_LEFT or SPEAKER_FRONT_RIGHT, the sound is coming always from FRONT LEFT speaker. With  SPEAKER_FRONT_LEFT and SPEAKER_FRONT_RIGHT it works.
    Stream contains only "single sound data". Is it possible to use these configuration to put sound to separate channel or should i use 8 channels configuration and fill stream data only in position for desired channel/speaker (for example FRONT CENTER )?

    Thank you,
    Marek

    středa 27. června 2012 18:36