src/media/audio/audio_core/test/api/audio_renderer_pipeline_test.cc
// Validate that timestamped packets play through renderer to ring buffer as expected.
Validate that timestamped packets play through renderer to ring buffer as expected.
Validate that timestamped packets play through renderer to ring buffer as expected .
TEST_F(AudioRendererPipelineTestInt16, RenderWithPts) {
  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 ( AudioRendererPipelineTestInt16 , RenderWithPts ) { 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 ) ; }
Validate that timestamped packets play through renderer to ring buffer as expected.
Validate that timestamped packets play through renderer to ring buffer as expected .
// The ring buffer should match the input buffer for the first num_packets. // The remaining bytes should be zeros.