src/media/audio/audio_core/mixer/test/mixer_response_tests.cc
// For each summary frequency, populate a sinusoid into a mono buffer, and copy-interleave mono[]
// into one of the channels of the N-channel source.
For each summary frequency, populate a sinusoid into a mono buffer, and copy-interleave mono[]
into one of the channels of the N-channel source.
For each summary frequency populate a sinusoid into a mono buffer and copy - interleave mono [] into one of the channels of the N - channel source .
AudioBuffer<ASF::FLOAT> PopulateNxNSourceBuffer(size_t num_frames, uint32_t num_chans,
                                                uint32_t rate) {
  auto format = Format::Create<ASF::FLOAT>(num_chans, rate).take_value();
  auto source = AudioBuffer(format, num_frames);
  for (uint32_t idx = 0; idx < num_chans; ++idx) {
    uint32_t freq_idx = FrequencySet::kSummaryIdxs[idx];
    if (FrequencySet::kReferenceFreqs[freq_idx] * 2 > num_frames) {
      continue;
    }
    auto format = Format::Create<ASF::FLOAT>(1, 48000 ).take_value();
    auto mono = GenerateCosineAudio(format, num_frames, FrequencySet::kReferenceFreqs[freq_idx]);
    for (uint32_t frame_num = 0; frame_num < num_frames; ++frame_num) {
      source.samples()[frame_num * num_chans + idx] = mono.samples()[frame_num];
    }
  }
  return source;
}
AudioBuffer < ASF :: FLOAT > PopulateNxNSourceBuffer ( size_t num_frames , uint32_t num_chans , uint32_t rate ) { auto format = Format :: Create < ASF :: FLOAT > ( num_chans , rate ) . take_value ( ) ; auto source = AudioBuffer ( format , num_frames ) ; for ( uint32_t idx = 0 ; idx < num_chans ; ++ idx ) { uint32_t freq_idx = FrequencySet :: kSummaryIdxs [ idx ] ; if ( FrequencySet :: kReferenceFreqs [ freq_idx ] * 2 > num_frames ) { continue ; } auto format = Format :: Create < ASF :: FLOAT > ( 1 , 48000 ) . take_value ( ) ; auto mono = GenerateCosineAudio ( format , num_frames , FrequencySet :: kReferenceFreqs [ freq_idx ] ) ; for ( uint32_t frame_num = 0 ; frame_num < num_frames ; ++ frame_num ) { source . samples ( ) [ frame_num * num_chans + idx ] = mono . samples ( ) [ frame_num ] ; } } return source ; }
For each summary frequency, populate a sinusoid into a mono buffer, and copy-interleave mono[]
into one of the channels of the N-channel source.
For each summary frequency populate a sinusoid into a mono buffer and copy - interleave mono [] into one of the channels of the N - channel source .
// For each summary frequency, populate a sinusoid into mono, and copy-interleave mono into one of // the channels of the N-channel source. // If frequency is too high to be characterized in this buffer length, skip it. // Populate mono[] with a sinusoid at this reference-frequency. /* unused */ // Copy-interleave mono into the N-channel source[].