Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion webrtc-sys/src/audio_resampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "audio/remix_resample.h"
#include "api/audio/audio_view.h"
#include "api/audio/audio_frame.h"

namespace livekit {

Expand All @@ -31,6 +32,7 @@ size_t AudioResampler::remix_and_resample(const int16_t* src,
int dest_sample_rate) {
frame_.num_channels_ = dest_num_channels;
frame_.sample_rate_hz_ = dest_sample_rate;
frame_.samples_per_channel_ = webrtc::SampleRateToDefaultChannelSize(dest_sample_rate);
webrtc::InterleavedView<const int16_t> source(static_cast<const int16_t*>(src),
samples_per_channel,
num_channels);
Expand All @@ -47,4 +49,4 @@ std::unique_ptr<AudioResampler> create_audio_resampler() {
return std::make_unique<AudioResampler>();
}

} // namespace livekit
} // namespace livekit