Skip to content

Commit d0fcd3e

Browse files
committed
fix: unused variable, android player pointer usage
1 parent 6d61fbd commit d0fcd3e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/react-native-audio-api/android/src/main/cpp/AudioPlayer/AudioPlayer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
#include "AudioPlayer.h"
21

32
#include "AudioBus.h"
3+
#include "Constants.h"
4+
#include "AudioArray.h"
5+
#include "AudioPlayer.h"
46
#include "AudioContext.h"
57

68
namespace audioapi {
@@ -49,12 +51,12 @@ DataCallbackResult AudioPlayer::onAudioReady(
4951
int32_t numFrames) {
5052
auto buffer = static_cast<float *>(audioData);
5153

52-
renderAudio_(mBus_, numFrames);
54+
renderAudio_(mBus_.get(), numFrames);
5355

5456
// TODO: optimize this with SIMD?
5557
for (int32_t i = 0; i < numFrames; i += 1) {
5658
for (int channel = 0; channel < CHANNEL_COUNT; channel += 1) {
57-
buffer[i * CHANNEL_COUNT + channel] = mBus_->getChannel(channel)->get()[i];
59+
buffer[i * CHANNEL_COUNT + channel] = mBus_->getChannel(channel)->getData()[i];
5860
}
5961
}
6062

packages/react-native-audio-api/common/cpp/core/AudioBufferSourceNode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ void AudioBufferSourceNode::setBuffer(
3838
// Note: AudioBus copy method will use memcpy if the source buffer and system processing bus have same channel count,
3939
// otherwise it will use the summing function taking care of up/down mixing.
4040
void AudioBufferSourceNode::processNode(AudioBus* processingBus, int framesToProcess) {
41-
double time = context_->getCurrentTime();
42-
4341
// No audio data to fill, zero the output and return.
4442
if (!isPlaying() || !buffer_ || buffer_->getLength() == 0) {
4543
processingBus->zero();

0 commit comments

Comments
 (0)