src/media/audio/audio_core/audio_output_unittest.cc
// Verify AudioOutput loudness transform is updated with the |volume_curve| used in SetupMixTask.
Verify AudioOutput loudness transform is updated with the |volume_curve| used in SetupMixTask.
Verify AudioOutput loudness transform is updated with the |volume_curve| used in SetupMixTask .
TEST_F(AudioOutputTest, UpdateLoudnessTransformOnSetupMixTask) {
  static const TimelineFunction kOneFramePerMs = TimelineFunction(TimelineRate(1, 1'000'000));
  static const VolumeCurve volume_curve = VolumeCurve::DefaultForMinGain(-10.);
  static DeviceConfig::OutputDeviceProfile profile = DeviceConfig::OutputDeviceProfile(
      true,
      StreamUsageSetFromRenderUsages(kFidlRenderUsages),
      false, PipelineConfig::Default(),
      0.0, volume_curve);
  audio_output_->SetupMixTask(profile, zx::msec(1).to_msecs(), kOneFramePerMs);
  auto output_transform = audio_output_->profile().loudness_transform();
  auto expected_transform = std::make_shared<MappedLoudnessTransform>(volume_curve);
  EXPECT_FLOAT_EQ(output_transform->Evaluate<1>({VolumeValue{.5}}),
                  expected_transform->Evaluate<1>({VolumeValue{.5}}));
}
TEST_F ( AudioOutputTest , UpdateLoudnessTransformOnSetupMixTask ) { static const TimelineFunction kOneFramePerMs = TimelineFunction ( TimelineRate ( 1 , 1'000'000 ) ) ; static const VolumeCurve volume_curve = VolumeCurve :: DefaultForMinGain ( -10. ) ; static DeviceConfig :: OutputDeviceProfile profile = DeviceConfig :: OutputDeviceProfile ( true , StreamUsageSetFromRenderUsages ( kFidlRenderUsages ) , false , PipelineConfig :: Default ( ) , 0.0 , volume_curve ) ; audio_output_ -> SetupMixTask ( profile , zx :: msec ( 1 ) . to_msecs ( ) , kOneFramePerMs ) ; auto output_transform = audio_output_ -> profile ( ) . loudness_transform ( ) ; auto expected_transform = std :: make_shared < MappedLoudnessTransform > ( volume_curve ) ; EXPECT_FLOAT_EQ ( output_transform -> Evaluate < 1 > ( { VolumeValue { .5 } } ) , expected_transform -> Evaluate < 1 > ( { VolumeValue { .5 } } ) ) ; }
Verify AudioOutput loudness transform is updated with the |volume_curve| used in SetupMixTask.
Verify AudioOutput loudness transform is updated with the |volume_curve| used in SetupMixTask .
/*eligible_for_loopback=*/ /*supported_usages=*/ /*independent_volume_control=*/ /*pipeline_config=*/ /*driver_gain_db=*/