aboutsummaryrefslogtreecommitdiff
path: root/samples/SoundBoard/src/main/cpp/Synth.h
diff options
context:
space:
mode:
Diffstat (limited to 'samples/SoundBoard/src/main/cpp/Synth.h')
-rw-r--r--samples/SoundBoard/src/main/cpp/Synth.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/SoundBoard/src/main/cpp/Synth.h b/samples/SoundBoard/src/main/cpp/Synth.h
index 47aa2fa7..ef28a3a6 100644
--- a/samples/SoundBoard/src/main/cpp/Synth.h
+++ b/samples/SoundBoard/src/main/cpp/Synth.h
@@ -36,6 +36,8 @@ public:
}
Synth(const int32_t sampleRate, const int32_t channelCount, const int32_t numSignals) {
+ mNumSignals = numSignals;
+ mOscs = std::make_unique<SynthSound[]>(numSignals);
float curFrequency = kOscBaseFrequency;
float curAmplitude = kOscBaseAmplitude;
for (int i = 0; i < numSignals; ++i) {
@@ -82,7 +84,7 @@ public:
private:
// Rendering objects
int32_t mNumSignals;
- std::array<SynthSound, kMaxTracks> mOscs;
+ std::unique_ptr<SynthSound[]> mOscs;
Mixer mMixer;
MonoToStereo mConverter = MonoToStereo(&mMixer);
IRenderableAudio *mOutputStage; // This will point to either the mixer or converter, so it needs to be raw