File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
packages/react-native-audio-api
android/src/main/cpp/AudioPlayer Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- #include " AudioPlayer.h"
2
1
3
2
#include " AudioBus.h"
3
+ #include " Constants.h"
4
+ #include " AudioArray.h"
5
+ #include " AudioPlayer.h"
4
6
#include " AudioContext.h"
5
7
6
8
namespace audioapi {
@@ -49,12 +51,12 @@ DataCallbackResult AudioPlayer::onAudioReady(
49
51
int32_t numFrames) {
50
52
auto buffer = static_cast <float *>(audioData);
51
53
52
- renderAudio_ (mBus_ , numFrames);
54
+ renderAudio_ (mBus_ . get () , numFrames);
53
55
54
56
// TODO: optimize this with SIMD?
55
57
for (int32_t i = 0 ; i < numFrames; i += 1 ) {
56
58
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];
58
60
}
59
61
}
60
62
Original file line number Diff line number Diff line change @@ -38,8 +38,6 @@ void AudioBufferSourceNode::setBuffer(
38
38
// Note: AudioBus copy method will use memcpy if the source buffer and system processing bus have same channel count,
39
39
// otherwise it will use the summing function taking care of up/down mixing.
40
40
void AudioBufferSourceNode::processNode (AudioBus* processingBus, int framesToProcess) {
41
- double time = context_->getCurrentTime ();
42
-
43
41
// No audio data to fill, zero the output and return.
44
42
if (!isPlaying () || !buffer_ || buffer_->getLength () == 0 ) {
45
43
processingBus->zero ();
You can’t perform that action at this time.
0 commit comments