src/media/audio/audio_core/mixer/test/mixer_tests_shared.cc
// Use the supplied mixer to scale from src into accum buffers.  Assumes a
// specific buffer size, with no SRC, starting at the beginning of each buffer.
// By default, does not gain-scale or accumulate (both can be overridden).
Use the supplied mixer to scale from src into accum buffers.  Assumes a
specific buffer size, with no SRC, starting at the beginning of each buffer.
By default, does not gain-scale or accumulate (both can be overridden).
Use the supplied mixer to scale from src into accum buffers . Assumes a specific buffer size with no SRC starting at the beginning of each buffer . By default does not gain - scale or accumulate ( both can be overridden ) .
void DoMix(Mixer* mixer, const void* src_buf, float* accum_buf, bool accumulate, int32_t num_frames,
           float gain_db) {
  uint32_t dest_offset = 0;
  int32_t frac_src_offset = 0;
  auto& info = mixer->bookkeeping();
  info.gain.SetSourceGain(gain_db);
  bool mix_result = mixer->Mix(accum_buf, num_frames, &dest_offset, src_buf,
                               num_frames << kPtsFractionalBits, &frac_src_offset, accumulate);
  EXPECT_TRUE(mix_result);
  EXPECT_EQ(dest_offset, static_cast<uint32_t>(num_frames));
  EXPECT_EQ(frac_src_offset, static_cast<int32_t>(dest_offset << kPtsFractionalBits));
}
void DoMix ( Mixer * mixer , const void * src_buf , float * accum_buf , bool accumulate , int32_t num_frames , float gain_db ) { uint32_t dest_offset = 0 ; int32_t frac_src_offset = 0 ; auto & info = mixer -> bookkeeping ( ) ; info . gain . SetSourceGain ( gain_db ) ; bool mix_result = mixer -> Mix ( accum_buf , num_frames , & dest_offset , src_buf , num_frames << kPtsFractionalBits , & frac_src_offset , accumulate ) ; EXPECT_TRUE ( mix_result ) ; EXPECT_EQ ( dest_offset , static_cast < uint32_t > ( num_frames ) ) ; EXPECT_EQ ( frac_src_offset , static_cast < int32_t > ( dest_offset << kPtsFractionalBits ) ) ; }
Use the supplied mixer to scale from src into accum buffers.
Use the supplied mixer to scale from src into accum buffers .