Skip to content

Commit

Permalink
fix audiosource bit depth (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Oct 2, 2024
1 parent 10b10c7 commit a44934c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webrtc-sys/src/audio_track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ AudioTrackSource::InternalSource::InternalSource(

if (buffer_.size() >= samples10ms) {
for (auto sink : sinks_)
sink->OnData(buffer_.data(), sizeof(int16_t), sample_rate_,
sink->OnData(buffer_.data(), sizeof(int16_t) * 8, sample_rate_,
num_channels_, samples10ms / num_channels_);

buffer_.erase(buffer_.begin(), buffer_.begin() + samples10ms);
} else {
missed_frames_++;
if (missed_frames_ >= silence_frames_threshold) {
for (auto sink : sinks_)
sink->OnData(silence_buffer_, sizeof(int16_t), sample_rate_,
sink->OnData(silence_buffer_, sizeof(int16_t) * 8, sample_rate_,
num_channels_, samples10ms / num_channels_);
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@ bool AudioTrackSource::InternalSource::capture_frame(
} else {
// capture directly when the queue buffer is 0 (frame size must be 10ms)
for (auto sink : sinks_)
sink->OnData(data.data(), sizeof(int16_t), sample_rate,
sink->OnData(data.data(), sizeof(int16_t) * 8, sample_rate,
number_of_channels, number_of_frames);
}

Expand Down

0 comments on commit a44934c

Please sign in to comment.