#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
#include <assert.h>
#include <math.h>
#include <algorithm>
#include <memory>
#include <utility>
#include "base/ranges/algorithm.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_audio_bus.h"
#include "third_party/blink/renderer/platform/audio/denormal_disabler.h"
#include "third_party/blink/renderer/platform/audio/sinc_resampler.h"
#include "third_party/blink/renderer/platform/audio/vector_math.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
namespace blink {
Vadd;
Vsma;
const unsigned kMaxBusChannels = …;
scoped_refptr<AudioBus> AudioBus::Create(unsigned number_of_channels,
uint32_t length,
bool allocate) { … }
AudioBus::AudioBus(unsigned number_of_channels, uint32_t length, bool allocate)
: … { … }
void AudioBus::SetChannelMemory(unsigned channel_index,
float* storage,
uint32_t length) { … }
void AudioBus::ResizeSmaller(uint32_t new_length) { … }
void AudioBus::Zero() { … }
AudioChannel* AudioBus::ChannelByType(unsigned channel_type) { … }
const AudioChannel* AudioBus::ChannelByType(unsigned type) const { … }
bool AudioBus::TopologyMatches(const AudioBus& bus) const { … }
scoped_refptr<AudioBus> AudioBus::CreateBufferFromRange(
const AudioBus* source_buffer,
unsigned start_frame,
unsigned end_frame) { … }
float AudioBus::MaxAbsValue() const { … }
void AudioBus::Normalize() { … }
void AudioBus::Scale(float scale) { … }
void AudioBus::CopyFrom(const AudioBus& source_bus,
ChannelInterpretation channel_interpretation) { … }
void AudioBus::SumFrom(const AudioBus& source_bus,
ChannelInterpretation channel_interpretation) { … }
void AudioBus::DiscreteSumFrom(const AudioBus& source_bus) { … }
void AudioBus::SumFromByUpMixing(const AudioBus& source_bus) { … }
void AudioBus::SumFromByDownMixing(const AudioBus& source_bus) { … }
void AudioBus::CopyWithGainFrom(const AudioBus& source_bus, float gain) { … }
void AudioBus::CopyWithSampleAccurateGainValuesFrom(
const AudioBus& source_bus,
float* gain_values,
unsigned number_of_gain_values) { … }
scoped_refptr<AudioBus> AudioBus::CreateBySampleRateConverting(
const AudioBus* source_bus,
bool mix_to_mono,
double new_sample_rate) { … }
scoped_refptr<AudioBus> AudioBus::CreateByMixingToMono(
const AudioBus* source_bus) { … }
bool AudioBus::IsSilent() const { … }
void AudioBus::ClearSilentFlag() { … }
scoped_refptr<AudioBus> DecodeAudioFileData(const char* data, size_t size) { … }
scoped_refptr<AudioBus> AudioBus::GetDataResource(int resource_id,
float sample_rate) { … }
scoped_refptr<AudioBus> AudioBus::CreateBusFromInMemoryAudioFile(
const void* data,
size_t data_size,
bool mix_to_mono,
float sample_rate) { … }
}