-
Notifications
You must be signed in to change notification settings - Fork 262
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
Add channel mapping support #305
base: master
Are you sure you want to change the base?
Add channel mapping support #305
Conversation
@psobot a more flexible approach would be to take an optional layout and fallback to the changes I introduced here if not provided. Notice that channel count -> layout is a one-to-many relationship. |
Thanks @dodeca-6-tope! This looks great - is there a plugin I can test this with before merging? |
@psobot not that I know of, but you can verify this change by writing and playing a multichannel track on your receiver if you have one lying around. Audacity also fills up the channels with the correct signals unlike before. The first thing I did is to look for a visualizer but I haven't found any. |
Whoops, my apologies - I misread this as applying to |
After digging a bit deeper, I'm not sure this will actually change anything when writing audio files. From what I can tell, only the return createWriterFor (out, sampleRate, WavFileHelpers::canonicalWavChannelSet (static_cast<int> (numChannels)),
bitsPerSample, metadataValues, qualityOptionIndex); ...which does the same thing as inline AudioChannelSet canonicalWavChannelSet (int numChannels)
{
if (numChannels == 1) return AudioChannelSet::mono();
if (numChannels == 2) return AudioChannelSet::stereo();
if (numChannels == 3) return AudioChannelSet::createLCR();
if (numChannels == 4) return AudioChannelSet::quadraphonic();
if (numChannels == 5) return AudioChannelSet::create5point0();
if (numChannels == 6) return AudioChannelSet::create5point1();
if (numChannels == 7) return AudioChannelSet::create7point0SDDS();
if (numChannels == 8) return AudioChannelSet::create7point1SDDS();
return AudioChannelSet::discreteChannels (numChannels);
} Have you tested this change locally? All of my tests with different channel counts and audio formats seem to produce identical files before and after this change (except for Ogg Vorbis, for which the encoding process is not 100% deterministic). |
Tested on a receiver that initially mapped a down-mixed version (to mono) of the file to all channels equally and after this change it mapped as expected. |
Might be an issue with the receiver, will try again tomorrow with another device. |
Map channels to their respective speakers for supported audio formats. This change solves an issue where receivers can't determine how to map channels for multi channel audio files.