mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
audio: asio "downmix" 7.1 to stereo (#736)
## Link to GitHub Issue or related Pull Request, if one exists #730 ## Description of change Add an option that extracts channels from 7.1 ASIO and presents to 2-ch ASIO. Same idea as the SDVX 2ch fix except for gitadora we are duplicating the center channel to front. ## Testing Tested SDVX and GFDM Arena.
This commit is contained in:
@@ -498,7 +498,7 @@ int main_implementation(int argc, char *argv[]) {
|
||||
games::sdvx::ASIO_DRIVER = options[launcher::Options::spice2x_SDVXAsioDriver].value_text();
|
||||
}
|
||||
if (options[launcher::Options::SDVXAsioTwoChannel].value_bool()) {
|
||||
WrappedAsio::FORCE_TWO_CHANNELS = true;
|
||||
WrappedAsio::STEREO_DOWNMIX = WrappedAsio::StereoDownmix::Front;
|
||||
}
|
||||
if (options[launcher::Options::spice2x_SDVXSubPos].is_active()) {
|
||||
auto txt = options[launcher::Options::spice2x_SDVXSubPos].value_text();
|
||||
@@ -710,6 +710,7 @@ int main_implementation(int argc, char *argv[]) {
|
||||
}
|
||||
if (options[launcher::Options::GitaDoraTwoChannelAudio].value_bool()) {
|
||||
games::gitadora::TWOCHANNEL = true;
|
||||
WrappedAsio::STEREO_DOWNMIX = WrappedAsio::StereoDownmix::Center;
|
||||
}
|
||||
if (options[launcher::Options::GitaDoraLefty].is_active()) {
|
||||
const auto text = options[launcher::Options::GitaDoraLefty].value_text();
|
||||
@@ -1106,6 +1107,12 @@ int main_implementation(int argc, char *argv[]) {
|
||||
auto &name = options[launcher::Options::DownmixAudioToStereo].value_text();
|
||||
hooks::audio::DOWNMIX_ALGORITHM = hooks::audio::Downmix::name_to_algorithm(name.c_str());
|
||||
}
|
||||
if (options[launcher::Options::AsioDownmixToStereo].is_active()) {
|
||||
// routes the selected pair onto the device's 2.0 front output; a non-None selection
|
||||
// implies force-two-channel (see WrappedAsio::force_two_channels)
|
||||
auto &name = options[launcher::Options::AsioDownmixToStereo].value_text();
|
||||
WrappedAsio::STEREO_DOWNMIX = WrappedAsio::name_to_stereo_downmix(name.c_str());
|
||||
}
|
||||
if (options[launcher::Options::VolumeBoost].is_active()) {
|
||||
const double decibels = std::strtod(
|
||||
options[launcher::Options::VolumeBoost].value_text().c_str(), nullptr);
|
||||
|
||||
@@ -1086,10 +1086,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
||||
{
|
||||
.title = "GitaDora Two Channel Audio",
|
||||
.name = "2ch",
|
||||
.desc = "Attempt to reduce audio channels down to just two channels.\n\n"
|
||||
"Arena Model: downmixes 7.1 to stereo using the AC-4 stereo downmix coefficients "
|
||||
"(ETSI TS 103 190-1). The WASAPI Stereo Downmix option, if set, overrides this "
|
||||
"algorithm.",
|
||||
.desc = "Attempt to reduce audio channels down to just two channels.",
|
||||
.type = OptionType::Bool,
|
||||
.game_name = "GitaDora",
|
||||
.category = "Game Options",
|
||||
@@ -1985,6 +1982,26 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
||||
{"side", "Side channels only"},
|
||||
},
|
||||
},
|
||||
{
|
||||
// AsioDownmixToStereo
|
||||
.title = "ASIO 7.1 to Stereo Downmix",
|
||||
.name = "asiodownmix",
|
||||
.desc = "Extracts a single stereo channel pair from a multi-channel ASIO output, "
|
||||
"mapping the selected pair to the device's first two channels.\n\n"
|
||||
"Channel pairs assume a standard 7.1 ASIO layout (0-indexed):\n\n"
|
||||
"front: channels 0/1 (front left/right).\n\n"
|
||||
"center: channel 2 (front center, duplicated to both outputs).\n\n"
|
||||
"rear: channels 4/5 (rear left/right).\n\n"
|
||||
"side: channels 6/7 (side left/right).",
|
||||
.type = OptionType::Enum,
|
||||
.category = "Audio",
|
||||
.elements = {
|
||||
{"front", "Front channels (0/1)"},
|
||||
{"center", "Center channel (2)"},
|
||||
{"rear", "Rear channels (4/5)"},
|
||||
{"side", "Side channels (6/7)"},
|
||||
},
|
||||
},
|
||||
{
|
||||
// VolumeBoost
|
||||
.title = "WASAPI/ASIO Boost Audio Volume",
|
||||
|
||||
@@ -202,6 +202,7 @@ namespace launcher {
|
||||
AsioDriverName,
|
||||
AudioDummy,
|
||||
DownmixAudioToStereo,
|
||||
AsioDownmixToStereo,
|
||||
VolumeBoost,
|
||||
AudioResample,
|
||||
AudioExclusiveBuffer,
|
||||
|
||||
Reference in New Issue
Block a user