react-native-sin-wave
v0.1.2
Published
A React Native library for generating and playing sine wave sounds.
Readme
react-native-sin-wave
A React Native library for generating and playing sine wave sounds.
Installation
npm install react-native-sin-waveor
yarn add react-native-sin-waveUsage
Import the module
import SoundGenerator from 'react-native-sin-wave';Play a Sound
SoundGenerator.playSound(440); // Plays a 440 Hz sine wave (A4 note)Stop the Sound
SoundGenerator.stopSound();API
playSound(frequency: number): void
Plays a sine wave of the given frequency (in Hz).
Example:
SoundGenerator.playSound(528); // Play a 528 Hz frequencystopSound(): void
Stops the currently playing sound.
Example:
SoundGenerator.stopSound();Platform Support
- Android: Uses
AudioTrackAPI for sound synthesis. - iOS: Uses
AVFoundationfor sound synthesis.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
