src/media/audio/audio_core/test/api/audio_renderer_pipeline_test.cc
// Similar to RenderWithEffects, except we send a message to the effect to ask it to disable
// processing.
Similar to RenderWithEffects, except we send a message to the effect to ask it to disable
processing.
Similar to RenderWithEffects except we send a message to the effect to ask it to disable processing .
TEST_F(AudioRendererPipelineEffectsTest, EffectsControllerUpdateEffect) {
  fuchsia::media::audio::EffectsController_UpdateEffect_Result result;
  zx_status_t status = effects_controller_->UpdateEffect(kInverterEffectName, "disable", &result);
  EXPECT_EQ(status, ZX_OK);
  EXPECT_TRUE(result.is_response());
  const auto num_packets = NumPacketsPerBatch();
  const auto num_frames = num_packets * kPacketFrames;
  auto input_buffer = GenerateSequentialAudio<ASF::SIGNED_16>(format_, num_frames);
  auto packets = renderer_->AppendPackets({&input_buffer});
  renderer_->PlaySynchronized(this, output_, 0);
  renderer_->WaitForPackets(this, packets);
  auto ring_buffer = output_->SnapshotRingBuffer();
  CompareAudioBufferOptions opts;
  opts.num_frames_per_packet = kPacketFrames;
  opts.test_label = "check data";
  CompareAudioBuffers(AudioBufferSlice(&ring_buffer, 0, num_frames),
                      AudioBufferSlice(&input_buffer, 0, num_frames), opts);
  opts.test_label = "check silence";
  CompareAudioBuffers(AudioBufferSlice(&ring_buffer, num_frames, output_->frame_count()),
                      AudioBufferSlice<ASF::SIGNED_16>(), opts);
}
TEST_F ( AudioRendererPipelineEffectsTest , EffectsControllerUpdateEffect ) { fuchsia :: media :: audio :: EffectsController_UpdateEffect_Result result ; zx_status_t status = effects_controller_ -> UpdateEffect ( kInverterEffectName , " " , & result ) ; EXPECT_EQ ( status , ZX_OK ) ; EXPECT_TRUE ( result . is_response ( ) ) ; const auto num_packets = NumPacketsPerBatch ( ) ; const auto num_frames = num_packets * kPacketFrames ; auto input_buffer = GenerateSequentialAudio < ASF :: SIGNED_16 > ( format_ , num_frames ) ; auto packets = renderer_ -> AppendPackets ( { & input_buffer } ) ; renderer_ -> PlaySynchronized ( this , output_ , 0 ) ; renderer_ -> WaitForPackets ( this , packets ) ; auto ring_buffer = output_ -> SnapshotRingBuffer ( ) ; CompareAudioBufferOptions opts ; opts . num_frames_per_packet = kPacketFrames ; opts . test_label = " " ; CompareAudioBuffers ( AudioBufferSlice ( & ring_buffer , 0 , num_frames ) , AudioBufferSlice ( & input_buffer , 0 , num_frames ) , opts ) ; opts . test_label = " " ; CompareAudioBuffers ( AudioBufferSlice ( & ring_buffer , num_frames , output_ -> frame_count ( ) ) , AudioBufferSlice < ASF :: SIGNED_16 > ( ) , opts ) ; }
Similar to RenderWithEffects, except we send a message to the effect to ask it to disable
processing.
Similar to RenderWithEffects except we send a message to the effect to ask it to disable processing .
// Disable the inverter; frames should be unmodified. // The ring buffer should match the input buffer for the first num_packets. The remaining bytes // should be zeros.