Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel maps don't seem to be applying #11881

Open
isXander opened this issue Jan 8, 2025 · 0 comments
Open

Channel maps don't seem to be applying #11881

isXander opened this issue Jan 8, 2025 · 0 comments
Assignees
Labels
icculus-priority Things @icculus is looking at within a larger milestone.
Milestone

Comments

@isXander
Copy link
Contributor

isXander commented Jan 8, 2025

Situation

I have a logical device with 4 channels.

SDL_AudioDeviceID device;
SDL_AudioSpec devSpec;

I have stereo sound data.

void *audio;
int audioLength;
SDL_AudioSpec audioSpec; 

I create an audio stream and bind it to my device.

SDL_AudioStream steam = SDL_CreateAudioStream(audioSpec, devSpec);
SDL_BindAudioStream(device, stream);

My aim is to play the stereo sound on channels 3 and 4;

 Input1       Input 2
   |             |
   |             X--------------------------X
   |                                        |
   X--------------------------X             |
                              |             |
 Output1       Output2     Output3       Output 4

...So I set the following output channel map:

SDL_SetAudioStreamOutputChannelMap(stream, new int[]{ -1, -1, 0, 1 }, 4);

I interpret this as;

  • set output channel 0 to mute
  • set output channel 1 to mute
  • set output channel 2 to input channel 0
  • set output channel 3 to input channel 1

I finally put my audio onto the stream:

SDL_PutAudioStreamData(stream, audio, audioLength);

Problem

Regardless of what I seem to try, the end result always ends up being;

  Input1       Input 2
    |             |
    |             |
    |             |
    |             |
    |             |
 Output1       Output2     Output3       Output 4
@slouken slouken added this to the 3.2.0 milestone Jan 8, 2025
@icculus icculus added the icculus-priority Things @icculus is looking at within a larger milestone. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
icculus-priority Things @icculus is looking at within a larger milestone.
Projects
None yet
Development

No branches or pull requests

3 participants