diff --git a/cpp/OscillatorNode/OscillatorNodeWrapper.h b/cpp/OscillatorNode/OscillatorNodeWrapper.h index fefc2642..cf37e9d0 100644 --- a/cpp/OscillatorNode/OscillatorNodeWrapper.h +++ b/cpp/OscillatorNode/OscillatorNodeWrapper.h @@ -17,10 +17,6 @@ namespace audiocontext { class OscillatorNodeWrapper: public AudioNodeWrapper { #ifdef ANDROID std::shared_ptr oscillator_; -#else - std::shared_ptr oscillator_; -#endif - public: explicit OscillatorNodeWrapper(const std::shared_ptr &oscillator) : AudioNodeWrapper( oscillator), oscillator_(oscillator) {} diff --git a/example/src/App.tsx b/example/src/App.tsx index 9aac829d..cd16e67c 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -32,7 +32,8 @@ const App: React.FC = () => { if (Platform.OS === 'android') { const destination = audioContextRef.current.destination; - oscillatorRef.current.connect(destination!); + oscillatorRef.current.connect(gainRef.current); + gainRef.current.connect(destination!); } }; @@ -90,7 +91,7 @@ const App: React.FC = () => { /> - Gain: {gain.toFixed(1)} + Gain: {gain.toFixed(2)} Oscillator; + createGain: () => Gain; destination: AudioDestinationNode | null; };