src/media/audio/audio_core/test/api/audio_renderer_pipeline_test.cc
// Validate that the effects package is loaded and that it processes the input.
Validate that the effects package is loaded and that it processes the input.
Validate that the effects package is loaded and that it processes the input .
TEST_F(AudioRendererPipelineEffectsTest, RenderWithEffects) {
  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();
  RunInversionFilter(&input_buffer);
  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 , RenderWithEffects ) { 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 ( ) ; RunInversionFilter ( & input_buffer ) ; 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 ) ; }
Validate that the effects package is loaded and that it processes the input.
Validate that the effects package is loaded and that it processes the input .
// Simulate running the effect on the input buffer. // The ring buffer should match the transformed input buffer for the first num_packets. // The remaining bytes should be zeros.