Skip to content

Commit

Permalink
When converting ADM files, always use HEADPHONES_RENDERING_MODE_BINAU…
Browse files Browse the repository at this point in the history
…RAL.

PiperOrigin-RevId: 687393641
  • Loading branch information
felicialim authored and jwcullen committed Oct 18, 2024
1 parent ee675cc commit 3ed1e50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions iamf/cli/adm_to_user_metadata/iamf/mix_presentation_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,8 @@ absl::Status SubMixAudioElementHandler(
return input_layout.status();
}

// Set 'headphones_rendering_mode' to HEADPHONES_RENDERING_MODE_BINAURAL if
// typeDefinition is binaural, else set it to
// HEADPHONES_RENDERING_MODE_STEREO.
if (*input_layout == IamfInputLayout::kBinaural) {
rendering_config->set_headphones_rendering_mode(
iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_BINAURAL);
} else {
rendering_config->set_headphones_rendering_mode(
iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_STEREO);
}
rendering_config->set_headphones_rendering_mode(
iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_BINAURAL);

auto* mix_gain_param_definition =
sub_mix_audio_element.mutable_element_mix_gain();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ TEST(PopulateMixPresentation, PopulatesStereoSubmix) {
EXPECT_EQ(submix.output_mix_gain().default_mix_gain(), 0);
}

TEST(PopulateMixPresentation, SetsStereoRenderingModeForStereoAudioObject) {
TEST(PopulateMixPresentation, SetsBinauralRenderingModeForStereoAudioObject) {
const auto& mix_presentation_metadata =
GetMixObuMetataExpectOk({GetStereoAudioObject()});

EXPECT_EQ(mix_presentation_metadata.sub_mixes(0)
.audio_elements(0)
.rendering_config()
.headphones_rendering_mode(),
iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_STEREO);
iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_BINAURAL);
}

TEST(PopulateMixPresentation, SetsBinauralRenderingModeForBinauralAudioObject) {
Expand Down

0 comments on commit 3ed1e50

Please sign in to comment.