feat: reduce buffers to 1024
This commit is contained in:
@@ -18,16 +18,16 @@
|
||||
/** Provides music through a regular callback to oboe. Called from separate oboe thread. */
|
||||
class MusicProvider : public AudioCallbackProvider {
|
||||
public:
|
||||
explicit MusicProvider(RubberBand::RubberBandStretcher *stretcher);
|
||||
explicit MusicProvider(RubberBand::RubberBandStretcher *stretcher, size_t buf_size_samples);
|
||||
~MusicProvider() override;
|
||||
|
||||
/** Called from separate oboe thread. */
|
||||
void onAudioReady(float *data, int32_t frames) override;
|
||||
private:
|
||||
const size_t num_buf_samples = 48000;
|
||||
RubberBand::RubberBandStretcher *stretcher;
|
||||
float *buf;
|
||||
int idebug;
|
||||
size_t buf_size_samples;
|
||||
};
|
||||
|
||||
class PlaybackEngine : public StepListener {
|
||||
@@ -48,6 +48,8 @@ private:
|
||||
int android_fd;
|
||||
std::atomic<bool> haveTimeRatio;
|
||||
double timeRatio;
|
||||
int playbackRate;
|
||||
static size_t constexpr buf_size_samples = 1024;
|
||||
void initRubberBand();
|
||||
void closeRubberBand();
|
||||
void closeMusicFile();
|
||||
|
||||
Reference in New Issue
Block a user