Delete redundant files from samples
diff --git a/samples/hello-oboe/src/main/cpp/PlayAudioEngine.h b/samples/hello-oboe/src/main/cpp/PlayAudioEngine.h
index 08c8ba0..3e3b853 100644
--- a/samples/hello-oboe/src/main/cpp/PlayAudioEngine.h
+++ b/samples/hello-oboe/src/main/cpp/PlayAudioEngine.h
@@ -23,7 +23,6 @@
#include "shared/Mixer.h"
-#include "SineGenerator.h"
#include "SoundGenerator.h"
constexpr int32_t kBufferSizeAutomatic = 0;
diff --git a/samples/hello-oboe/src/main/cpp/SineGenerator.cpp b/samples/hello-oboe/src/main/cpp/SineGenerator.cpp
deleted file mode 100644
index 2d2f4a3..0000000
--- a/samples/hello-oboe/src/main/cpp/SineGenerator.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "SineGenerator.h"
-
-constexpr int kDefaultFrameRate = 48000;
-constexpr float kDefaultAmplitude = 0.01;
-constexpr float kDefaultFrequency = 440.0;
-constexpr double kTwoPi = M_PI * 2;
-
-SineGenerator::SineGenerator() {
- setup(kDefaultFrequency, kDefaultFrameRate, kDefaultAmplitude);
-}
-
-void SineGenerator::setup(double frequency, int32_t frameRate) {
- mFrameRate = frameRate;
- mPhaseIncrement = getPhaseIncremement(frequency);
-}
-
-void SineGenerator::setup(double frequency, int32_t frameRate, float amplitude) {
- setup(frequency, frameRate);
- mAmplitude = amplitude;
-}
-
-void SineGenerator::setSweep(double frequencyLow, double frequencyHigh, double seconds) {
- mPhaseIncrementLow = getPhaseIncremement(frequencyLow);
- mPhaseIncrementHigh = getPhaseIncremement(frequencyHigh);
-
- double numFrames = seconds * mFrameRate;
- mUpScaler = pow((frequencyHigh / frequencyLow), (1.0 / numFrames));
- mDownScaler = 1.0 / mUpScaler;
- mGoingUp = true;
- mSweeping = true;
-}
-
-void SineGenerator::render(int16_t *buffer, int32_t channelStride, int32_t numFrames) {
- int sampleIndex = 0;
- for (int i = 0; i < numFrames; i++) {
- buffer[sampleIndex] = static_cast<int16_t>(INT16_MAX * sinf(mPhase) * mAmplitude);
- sampleIndex += channelStride;
- advancePhase();
- }
-}
-
-void SineGenerator::render(float *buffer, int32_t channelStride, int32_t numFrames) {
- for (int i = 0, sampleIndex = 0; i < numFrames; i++) {
- buffer[sampleIndex] = static_cast<float>(sinf(mPhase) * mAmplitude);
- sampleIndex += channelStride;
- advancePhase();
- }
-}
-
-void SineGenerator::advancePhase() {
- mPhase += mPhaseIncrement;
- while (mPhase >= kTwoPi) {
- mPhase -= kTwoPi;
- }
- if (mSweeping) {
- if (mGoingUp) {
- mPhaseIncrement *= mUpScaler;
- if (mPhaseIncrement > mPhaseIncrementHigh) {
- mGoingUp = false;
- }
- } else {
- mPhaseIncrement *= mDownScaler;
- if (mPhaseIncrement < mPhaseIncrementLow) {
- mGoingUp = true;
- }
- }
- }
-}
-
-double SineGenerator::getPhaseIncremement(double frequency) {
- return frequency * kTwoPi / mFrameRate;
-}
\ No newline at end of file
diff --git a/samples/hello-oboe/src/main/cpp/SineGenerator.h b/samples/hello-oboe/src/main/cpp/SineGenerator.h
deleted file mode 100644
index c7a3f1a..0000000
--- a/samples/hello-oboe/src/main/cpp/SineGenerator.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OBOE_HELLOOBOE_SINE_GENERATOR_H
-#define OBOE_HELLOOBOE_SINE_GENERATOR_H
-
-#include <math.h>
-#include <cstdint>
-
-class SineGenerator
-{
-public:
- SineGenerator();
- ~SineGenerator() = default;
-
- void setup(double frequency, int32_t frameRate);
-
- void setup(double frequency, int32_t frameRate, float amplitude);
-
- void setSweep(double frequencyLow, double frequencyHigh, double seconds);
-
- void render(int16_t *buffer, int32_t channelStride, int32_t numFrames);
-
- void render(float *buffer, int32_t channelStride, int32_t numFrames);
-
-private:
- double mAmplitude;
- double mPhase = 0.0;
- int32_t mFrameRate;
- double mPhaseIncrement;
- double mPhaseIncrementLow;
- double mPhaseIncrementHigh;
- double mUpScaler = 1.0;
- double mDownScaler = 1.0;
- bool mGoingUp = false;
- bool mSweeping = false;
-
- void advancePhase();
-
- double getPhaseIncremement(double frequency);
-};
-
-#endif /* OBOE_HELLOOBOE_SINE_GENERATOR_H */
diff --git a/samples/shared/Oscillator.cpp b/samples/shared/Oscillator.cpp
deleted file mode 100644
index cdd77b2..0000000
--- a/samples/shared/Oscillator.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Oscillator.h"
-
-// We need to calculate the amplitude value differently for each supported output format
-/*template<>
-void Oscillator<float>::setAmplitude(float amplitude){
- mAmplitude = amplitude;
-};
-
-template<>
-void Oscillator<int16_t>::setAmplitude(float amplitude){
- mAmplitude = amplitude * INT16_MAX;
-};*/
\ No newline at end of file