├── .editorconfig ├── .eslintrc.js ├── .gitattributes ├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.yaml │ └── feature_request.yaml ├── actions │ ├── setup │ │ └── action.yml │ └── spelling │ │ ├── README.md │ │ ├── advice.md │ │ ├── allow.txt │ │ ├── candidate.patterns │ │ ├── excludes.txt │ │ ├── line_forbidden.patterns │ │ ├── only.txt │ │ └── patterns.txt ├── pull_request_template.md ├── release.yml └── workflows │ ├── ci.yml │ ├── publish-docs.yml │ └── spelling.yml ├── .gitignore ├── .nvmrc ├── .yarn └── releases │ └── yarn-4.5.0.cjs ├── .yarnrc.yml ├── COPYING ├── LICENSE ├── README.md ├── apps ├── common-app │ ├── index.ts │ ├── package.json │ ├── scripts │ │ └── dependencies.js │ ├── src │ │ ├── App.tsx │ │ ├── components │ │ │ ├── BGGradient.tsx │ │ │ ├── Button.tsx │ │ │ ├── Container.tsx │ │ │ ├── Icon.tsx │ │ │ ├── Select.tsx │ │ │ ├── Slider.tsx │ │ │ ├── Spacer.tsx │ │ │ ├── Switch.tsx │ │ │ ├── icomoonConfig.json │ │ │ └── index.ts │ │ ├── examples │ │ │ ├── AudioFile │ │ │ │ ├── AudioFile.tsx │ │ │ │ └── index.ts │ │ │ ├── AudioVisualizer │ │ │ │ ├── AudioVisualizer.tsx │ │ │ │ ├── Canvas.tsx │ │ │ │ ├── Charts.tsx │ │ │ │ ├── FreqTimeChart.tsx │ │ │ │ └── index.ts │ │ │ ├── DrumMachine │ │ │ │ ├── DrumMachine.tsx │ │ │ │ ├── Grid.tsx │ │ │ │ ├── NotesHighlight.tsx │ │ │ │ ├── PatternShape.tsx │ │ │ │ ├── PlayButton.tsx │ │ │ │ ├── constants.ts │ │ │ │ ├── index.ts │ │ │ │ ├── instruments.ts │ │ │ │ ├── presets.ts │ │ │ │ └── useGestures.ts │ │ │ ├── Metronome │ │ │ │ ├── Metronome.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── patterns.ts │ │ │ ├── OfflineRendering │ │ │ │ ├── OfflineRendering.tsx │ │ │ │ └── index.ts │ │ │ ├── Oscillator │ │ │ │ ├── Oscillator.tsx │ │ │ │ └── index.tsx │ │ │ ├── Piano │ │ │ │ ├── Keyboard.tsx │ │ │ │ ├── Piano.tsx │ │ │ │ ├── PianoNote.tsx │ │ │ │ ├── index.ts │ │ │ │ └── utils.ts │ │ │ ├── Record │ │ │ │ └── Record.tsx │ │ │ ├── TextToSpeech │ │ │ │ ├── TextToSpeech.tsx │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── styles.ts │ │ ├── types.ts │ │ └── utils │ │ │ ├── env.ts │ │ │ ├── skiUtils.ts │ │ │ ├── soundEngines │ │ │ ├── Clap.ts │ │ │ ├── HiHat.ts │ │ │ ├── Kick.ts │ │ │ ├── MetronomeSound.ts │ │ │ └── SoundEngine.ts │ │ │ ├── usePlayer.tsx │ │ │ └── withSeparators.ts │ └── tsconfig.json └── fabric-example │ ├── .bundle │ └── config │ ├── .eslintrc.js │ ├── .watchmanconfig │ ├── App.tsx │ ├── Gemfile │ ├── Gemfile.lock │ ├── README.md │ ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── ic_launcher-playstore.png │ │ │ ├── java │ │ │ └── com │ │ │ │ └── fabricexample │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ └── res │ │ │ ├── drawable │ │ │ ├── ic_launcher_background.xml │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ ├── ic_launcher_foreground.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ ├── ic_launcher_foreground.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ ├── ic_launcher_foreground.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ ├── ic_launcher_foreground.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ ├── ic_launcher_foreground.webp │ │ │ └── ic_launcher_round.webp │ │ │ └── values │ │ │ ├── ic_launcher_background.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle │ ├── app.json │ ├── assets │ └── fonts │ │ └── icomoon.ttf │ ├── babel.config.js │ ├── index.js │ ├── ios │ ├── .xcode.env │ ├── FabricExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── FabricExample.xcscheme │ ├── FabricExample.xcworkspace │ │ └── contents.xcworkspacedata │ ├── FabricExample │ │ ├── AppDelegate.swift │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── AppIcon.png │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── PrivacyInfo.xcprivacy │ ├── Podfile │ └── Podfile.lock │ ├── metro.config.js │ ├── package.json │ ├── react-native.config.js │ └── tsconfig.json ├── assets └── react-native-audio-api-gh-cover.png ├── lefthook.yml ├── package.json ├── packages ├── audiodocs │ ├── .eslintrc │ ├── .gitignore │ ├── .yarn │ │ └── releases │ │ │ └── yarn-1.22.22.cjs │ ├── .yarnrc.yml │ ├── README.md │ ├── babel.config.js │ ├── docs │ │ ├── analysis │ │ │ ├── _category_.json │ │ │ └── analyser-node.mdx │ │ ├── core │ │ │ ├── _category_.json │ │ │ ├── audio-context.mdx │ │ │ ├── audio-node.mdx │ │ │ ├── audio-param.mdx │ │ │ └── base-audio-context.mdx │ │ ├── destinations │ │ │ └── _category_.json │ │ ├── effects │ │ │ ├── _category_.json │ │ │ ├── gain-node.mdx │ │ │ └── stereo-panner-node.mdx │ │ ├── fundamentals │ │ │ ├── _category_.json │ │ │ ├── getting-started.mdx │ │ │ └── introduction.mdx │ │ ├── guides │ │ │ ├── _category_.json │ │ │ ├── lets-make-some-noise.mdx │ │ │ ├── making-a-piano-keyboard.mdx │ │ │ ├── noise-generation.mdx │ │ │ └── see-your-sound.mdx │ │ ├── other │ │ │ ├── _category_.json │ │ │ ├── audio-api-plugin.mdx │ │ │ ├── compatibility.mdx │ │ │ └── web-audio-api-coverage.mdx │ │ ├── sources │ │ │ ├── _category_.json │ │ │ ├── audio-buffer-source-node.mdx │ │ │ ├── audio-buffer.mdx │ │ │ ├── audio-scheduled-source-node.mdx │ │ │ └── oscillator-node.mdx │ │ ├── spatialization │ │ │ └── _category_.json │ │ ├── system │ │ │ ├── _category_.json │ │ │ └── audio-manager.mdx │ │ ├── types │ │ │ ├── _category_.json │ │ │ ├── audio-buffer-source-node-options.mdx │ │ │ ├── audio-context-options.mdx │ │ │ ├── channel-count-mode.mdx │ │ │ ├── channel-interpretation.mdx │ │ │ ├── context-state.mdx │ │ │ ├── oscillator-type.mdx │ │ │ ├── periodic-wave-constraints.mdx │ │ │ └── window-type.mdx │ │ └── worklets │ │ │ └── _category_.json │ ├── docusaurus.config.js │ ├── package.json │ ├── prettier.config.js │ ├── sidebars.js │ ├── src │ │ ├── components │ │ │ ├── AnimableIcon │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.css │ │ │ ├── AudioNodePropsTable │ │ │ │ └── index.tsx │ │ │ ├── Badges │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.css │ │ │ ├── Compatibility │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.css │ │ │ ├── InteractiveExample │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.css │ │ │ └── LandingPage │ │ │ │ ├── OscillatorSquare.module.css │ │ │ │ └── OscillatorSquare.tsx │ │ ├── css │ │ │ ├── colors.css │ │ │ ├── custom.css │ │ │ ├── overrides.css │ │ │ └── typography.css │ │ ├── examples │ │ │ ├── LetsMakeSomeNoise │ │ │ │ ├── Component.tsx │ │ │ │ └── Source.tsx │ │ │ ├── NoiseGeneration │ │ │ │ ├── BrownianNoiseComponent.tsx │ │ │ │ ├── BrownianNoiseSource.tsx │ │ │ │ ├── PinkNoiseComponent.tsx │ │ │ │ ├── PinkNoiseSource.tsx │ │ │ │ ├── WhiteNoiseComponent.tsx │ │ │ │ └── WhiteNoiseSource.tsx │ │ │ ├── SeeYourSound │ │ │ │ ├── BaseComponent.tsx │ │ │ │ ├── BaseSource.tsx │ │ │ │ ├── CanvasSizerComponent.tsx │ │ │ │ ├── FrequencyDomainComponent.tsx │ │ │ │ ├── FrequencyDomainSource.tsx │ │ │ │ ├── TimeDomainComponent.tsx │ │ │ │ └── TimeDomainSource.tsx │ │ │ └── SimplePiano │ │ │ │ ├── EnvelopesComponent.tsx │ │ │ │ ├── EnvelopesSource.tsx │ │ │ │ ├── FinalComponent.tsx │ │ │ │ ├── FinalSource.tsx │ │ │ │ ├── ItHangsComponent.tsx │ │ │ │ ├── ItHangsSource.tsx │ │ │ │ ├── PressOutComponent.tsx │ │ │ │ └── PressOutSource.tsx │ │ ├── hooks │ │ │ ├── usePageType.tsx │ │ │ └── useScreenSize.tsx │ │ └── theme │ │ │ ├── Admonition │ │ │ └── index.jsx │ │ │ ├── CodeBlock │ │ │ ├── highlighting-dark.js │ │ │ └── highlighting-light.js │ │ │ ├── DocCard │ │ │ └── index.jsx │ │ │ ├── DocItem │ │ │ ├── Metadata │ │ │ │ └── index.jsx │ │ │ └── TOC │ │ │ │ └── Mobile │ │ │ │ └── index.jsx │ │ │ ├── DocSidebar │ │ │ └── index.jsx │ │ │ ├── Footer │ │ │ └── index.jsx │ │ │ ├── Navbar │ │ │ └── index.jsx │ │ │ ├── NotFound │ │ │ └── index.jsx │ │ │ ├── PaginatorNavLink │ │ │ └── index.jsx │ │ │ ├── Root.jsx │ │ │ ├── SkipToContent │ │ │ ├── index.jsx │ │ │ └── styles.module.css │ │ │ ├── TOCCollapsible │ │ │ └── index.jsx │ │ │ ├── TOCItems │ │ │ ├── Tree.jsx │ │ │ └── index.jsx │ │ │ ├── Tabs │ │ │ ├── index.jsx │ │ │ └── styles.module.css │ │ │ └── muiTheme.jsx │ ├── static │ │ ├── .nojekyll │ │ ├── audio │ │ │ ├── music │ │ │ │ ├── example-music-01.mp3 │ │ │ │ ├── example-music-02.mp3 │ │ │ │ ├── example-music-03.mp3 │ │ │ │ └── example-music-04.mp3 │ │ │ ├── sounds │ │ │ │ ├── C4.mp3 │ │ │ │ ├── Ds4.mp3 │ │ │ │ └── Fs4.mp3 │ │ │ └── voice │ │ │ │ └── example-voice-01.mp3 │ │ ├── fonts │ │ │ ├── Aeonik-Bold.otf │ │ │ ├── Aeonik-Medium.otf │ │ │ ├── Aeonik-Regular.otf │ │ │ └── DMMono-Regular.ttf │ │ └── img │ │ │ ├── ADSR.svg │ │ │ ├── audio-graph.png │ │ │ ├── audioBuffer.png │ │ │ ├── copy-dark.svg │ │ │ ├── copy.svg │ │ │ ├── exponentialRampToValueAtTime.png │ │ │ ├── favicon.ico │ │ │ ├── frequencies-on-piano.jpg │ │ │ ├── gain-node.png │ │ │ ├── github.svg │ │ │ ├── linearRampToValueAtTime.png │ │ │ ├── logo-hero.svg │ │ │ ├── logo.svg │ │ │ ├── oscillator-waves.png │ │ │ ├── reset-dark.svg │ │ │ ├── reset.svg │ │ │ ├── setTargetAtTime.png │ │ │ ├── setValueAtTime.png │ │ │ ├── setValueCurveAtTime.png │ │ │ ├── time_domain_vs_frequency_domain.jpg │ │ │ ├── title-dark.svg │ │ │ └── title.svg │ ├── tsconfig.json │ └── yarn.lock └── react-native-audio-api │ ├── .clang-format │ ├── .eslintrc.js │ ├── .prettierignore │ ├── .watchmanconfig │ ├── RNAudioAPI.podspec │ ├── android │ ├── CMakeLists.txt │ ├── build.gradle │ ├── gradle.properties │ └── src │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── AndroidManifestNew.xml │ │ ├── cpp │ │ │ └── audioapi │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── android │ │ │ │ ├── AudioAPIModule.cpp │ │ │ │ ├── AudioAPIModule.h │ │ │ │ ├── OnLoad.cpp │ │ │ │ └── core │ │ │ │ ├── AndroidAudioRecorder.cpp │ │ │ │ ├── AndroidAudioRecorder.h │ │ │ │ ├── AudioDecoder.cpp │ │ │ │ ├── AudioPlayer.cpp │ │ │ │ └── AudioPlayer.h │ │ ├── java │ │ │ └── com │ │ │ │ └── swmansion │ │ │ │ └── audioapi │ │ │ │ ├── AudioAPIModule.kt │ │ │ │ ├── AudioAPIPackage.kt │ │ │ │ └── system │ │ │ │ ├── AudioFocusListener.kt │ │ │ │ ├── LockScreenManager.kt │ │ │ │ ├── MediaNotificationManager.kt │ │ │ │ ├── MediaReceiver.kt │ │ │ │ ├── MediaSessionCallback.kt │ │ │ │ ├── MediaSessionManager.kt │ │ │ │ ├── PermissionRequestListener.kt │ │ │ │ └── VolumeChangeListener.kt │ │ └── res │ │ │ └── drawable │ │ │ ├── next.xml │ │ │ ├── pause.xml │ │ │ ├── play.xml │ │ │ ├── previous.xml │ │ │ ├── skip_backward_10.xml │ │ │ ├── skip_forward_10.xml │ │ │ └── stop.xml │ │ └── oldarch │ │ └── NativeAudioAPIModuleSpec.java │ ├── app.plugin.js │ ├── babel.config.js │ ├── common │ └── cpp │ │ └── audioapi │ │ ├── AudioAPIModuleInstaller.h │ │ ├── HostObjects │ │ ├── AnalyserNodeHostObject.h │ │ ├── AudioBufferHostObject.h │ │ ├── AudioBufferQueueSourceNodeHostObject.h │ │ ├── AudioBufferSourceNodeHostObject.h │ │ ├── AudioContextHostObject.h │ │ ├── AudioDestinationNodeHostObject.h │ │ ├── AudioNodeHostObject.h │ │ ├── AudioParamHostObject.h │ │ ├── AudioRecorderHostObject.h │ │ ├── AudioScheduledSourceNodeHostObject.h │ │ ├── BaseAudioContextHostObject.h │ │ ├── BiquadFilterNodeHostObject.h │ │ ├── GainNodeHostObject.h │ │ ├── OfflineAudioContextHostObject.h │ │ ├── OscillatorNodeHostObject.h │ │ ├── PeriodicWaveHostObject.h │ │ └── StereoPannerNodeHostObject.h │ │ ├── core │ │ ├── AudioContext.cpp │ │ ├── AudioContext.h │ │ ├── AudioNode.cpp │ │ ├── AudioNode.h │ │ ├── AudioParam.cpp │ │ ├── AudioParam.h │ │ ├── BaseAudioContext.cpp │ │ ├── BaseAudioContext.h │ │ ├── Constants.h │ │ ├── OfflineAudioContext.cpp │ │ ├── OfflineAudioContext.h │ │ ├── analysis │ │ │ ├── AnalyserNode.cpp │ │ │ └── AnalyserNode.h │ │ ├── destinations │ │ │ ├── AudioDestinationNode.cpp │ │ │ └── AudioDestinationNode.h │ │ ├── effects │ │ │ ├── BiquadFilterNode.cpp │ │ │ ├── BiquadFilterNode.h │ │ │ ├── GainNode.cpp │ │ │ ├── GainNode.h │ │ │ ├── PeriodicWave.cpp │ │ │ ├── PeriodicWave.h │ │ │ ├── StereoPannerNode.cpp │ │ │ └── StereoPannerNode.h │ │ ├── inputs │ │ │ ├── AudioRecorder.cpp │ │ │ └── AudioRecorder.h │ │ ├── sources │ │ │ ├── AudioBuffer.cpp │ │ │ ├── AudioBuffer.h │ │ │ ├── AudioBufferQueueSourceNode.cpp │ │ │ ├── AudioBufferQueueSourceNode.h │ │ │ ├── AudioBufferSourceNode.cpp │ │ │ ├── AudioBufferSourceNode.h │ │ │ ├── AudioScheduledSourceNode.cpp │ │ │ ├── AudioScheduledSourceNode.h │ │ │ ├── OscillatorNode.cpp │ │ │ └── OscillatorNode.h │ │ ├── types │ │ │ ├── BiquadFilterType.h │ │ │ ├── ChannelCountMode.h │ │ │ ├── ChannelInterpretation.h │ │ │ ├── ContextState.h │ │ │ ├── OscillatorType.h │ │ │ └── ParamChangeEventType.h │ │ └── utils │ │ │ ├── AudioDecoder.h │ │ │ ├── AudioNodeDestructor.cpp │ │ │ ├── AudioNodeDestructor.h │ │ │ ├── AudioNodeManager.cpp │ │ │ ├── AudioNodeManager.h │ │ │ ├── Locker.h │ │ │ ├── ParamChangeEvent.cpp │ │ │ └── ParamChangeEvent.h │ │ ├── dsp │ │ ├── AudioUtils.cpp │ │ ├── AudioUtils.h │ │ ├── FFT.cpp │ │ ├── FFT.h │ │ ├── VectorMath.cpp │ │ ├── VectorMath.h │ │ ├── Windows.cpp │ │ └── Windows.h │ │ ├── events │ │ ├── AudioEventHandlerRegistry.cpp │ │ ├── AudioEventHandlerRegistry.h │ │ └── AudioEventHandlerRegistryHostObject.h │ │ ├── jsi │ │ ├── AudioArrayBuffer.cpp │ │ ├── AudioArrayBuffer.h │ │ ├── JsiHostObject.cpp │ │ ├── JsiHostObject.h │ │ ├── JsiPromise.cpp │ │ ├── JsiPromise.h │ │ ├── RuntimeAwareCache.h │ │ ├── RuntimeLifecycleMonitor.cpp │ │ └── RuntimeLifecycleMonitor.h │ │ ├── libs │ │ ├── base64 │ │ │ └── base64.h │ │ ├── miniaudio │ │ │ └── miniaudio.h │ │ ├── pffft │ │ │ ├── pffft.c │ │ │ └── pffft.h │ │ └── signalsmith-stretch │ │ │ ├── fft-accelerate.h │ │ │ ├── fft.h │ │ │ ├── signalsmith-stretch.h │ │ │ └── stft.h │ │ └── utils │ │ ├── AudioArray.cpp │ │ ├── AudioArray.h │ │ ├── AudioBus.cpp │ │ ├── AudioBus.h │ │ ├── CircularAudioArray.cpp │ │ └── CircularAudioArray.h │ ├── ios │ └── audioapi │ │ └── ios │ │ ├── AudioAPIModule.h │ │ ├── AudioAPIModule.mm │ │ ├── core │ │ ├── AudioDecoder.mm │ │ ├── IOSAudioPlayer.h │ │ ├── IOSAudioPlayer.mm │ │ ├── IOSAudioRecorder.h │ │ ├── IOSAudioRecorder.mm │ │ ├── NativeAudioPlayer.h │ │ ├── NativeAudioPlayer.m │ │ ├── NativeAudioRecorder.h │ │ └── NativeAudioRecorder.m │ │ ├── events │ │ ├── IOSAudioEventHandlerRegistry.h │ │ └── IOSAudioEventHandlerRegistry.mm │ │ └── system │ │ ├── AudioEngine.h │ │ ├── AudioEngine.mm │ │ ├── AudioSessionManager.h │ │ ├── AudioSessionManager.mm │ │ ├── LockScreenManager.h │ │ ├── LockScreenManager.mm │ │ ├── NotificationManager.h │ │ └── NotificationManager.mm │ ├── metro-config │ ├── index.d.ts │ ├── index.js │ └── tsconfig.json │ ├── package.json │ ├── scripts │ ├── cpplint.sh │ ├── create-package.sh │ └── setup-rn-audio-api-web.js │ ├── src │ ├── api.ts │ ├── api.web.ts │ ├── core │ │ ├── AnalyserNode.ts │ │ ├── AudioBuffer.ts │ │ ├── AudioBufferQueueSourceNode.ts │ │ ├── AudioBufferSourceNode.ts │ │ ├── AudioContext.ts │ │ ├── AudioDestinationNode.ts │ │ ├── AudioNode.ts │ │ ├── AudioParam.ts │ │ ├── AudioRecorder.ts │ │ ├── AudioScheduledSourceNode.ts │ │ ├── BaseAudioContext.ts │ │ ├── BiquadFilterNode.ts │ │ ├── GainNode.ts │ │ ├── OfflineAudioContext.ts │ │ ├── OscillatorNode.ts │ │ ├── PeriodicWave.ts │ │ └── StereoPannerNode.ts │ ├── errors │ │ ├── IndexSizeError.ts │ │ ├── InvalidAccessError.ts │ │ ├── InvalidStateError.ts │ │ ├── NotSupportedError.ts │ │ ├── RangeError.ts │ │ └── index.ts │ ├── events │ │ ├── AudioEventEmitter.ts │ │ ├── AudioEventSubscription.ts │ │ ├── index.ts │ │ └── types.ts │ ├── hooks │ │ └── useSytemVolume.ts │ ├── index.ts │ ├── interfaces.ts │ ├── plugin │ │ └── withAudioAPI.ts │ ├── specs │ │ ├── NativeAudioAPIModule.ts │ │ └── index.ts │ ├── system │ │ ├── AudioManager.ts │ │ ├── index.ts │ │ └── types.ts │ ├── types.ts │ ├── utils │ │ └── index.ts │ └── web-core │ │ ├── AnalyserNode.tsx │ │ ├── AudioBuffer.tsx │ │ ├── AudioBufferSourceNode.tsx │ │ ├── AudioContext.tsx │ │ ├── AudioDestinationNode.tsx │ │ ├── AudioNode.tsx │ │ ├── AudioParam.tsx │ │ ├── AudioScheduledSourceNode.tsx │ │ ├── BaseAudioContext.tsx │ │ ├── BiquadFilterNode.tsx │ │ ├── GainNode.tsx │ │ ├── OfflineAudioContext.tsx │ │ ├── OscillatorNode.tsx │ │ ├── PeriodicWave.tsx │ │ ├── StereoPannerNode.tsx │ │ └── custom │ │ ├── LoadCustomWasm.ts │ │ ├── index.ts │ │ └── signalsmithStretch │ │ ├── LICENSE.txt │ │ ├── README.md │ │ └── SignalsmithStretch.mjs │ ├── tsconfig.json │ └── turbo.json ├── prettier.config.js ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf 4 | docs/assets/example-01.mp4 filter=lfs diff=lfs merge=lfs -text 5 | 6 | packages/react-native-audio-api/common/cpp/audioapi/libs/** linguist-vendored 7 | apps/** linguist-vendored 8 | docs/** linguist-vendored 9 | .github/** linguist-vendored 10 | .yarn/** linguist-vendored 11 | packages/audiodocs/** linguist-documentation 12 | packages/react-native-audio-api/src/web-core/custom/signalsmithStretch/* linguist-vendored 13 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | /.github/CODEOWNERS @michalsek @maciejmakowski2003 2 | /.github/workflows @michalsek @maciejmakowski2003 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: software-mansion 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yaml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest a feature 3 | body: 4 | - type: textarea 5 | id: Suggestion 6 | attributes: 7 | label: Feature Request 8 | description: Describe the feature(s) you would like to be added. 9 | validations: 10 | required: true 11 | -------------------------------------------------------------------------------- /.github/actions/setup/action.yml: -------------------------------------------------------------------------------- 1 | name: Setup 2 | description: Setup Node.js and install dependencies 3 | 4 | runs: 5 | using: composite 6 | steps: 7 | - name: Setup Node.js 8 | uses: actions/setup-node@v4 9 | with: 10 | node-version-file: .nvmrc 11 | 12 | - name: Setup Python 13 | uses: actions/setup-python@v1 14 | 15 | - name: Install cpplint 16 | shell: bash 17 | run: pip install 'cpplint==2.0.0' 18 | 19 | - name: Install ktlint 20 | shell: bash 21 | run: | 22 | curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.5.0/ktlint 23 | chmod a+x ktlint 24 | sudo mv ktlint /usr/local/bin/ 25 | 26 | - name: Cache dependencies 27 | id: yarn-cache 28 | uses: actions/cache@v4 29 | with: 30 | path: | 31 | **/node_modules 32 | .yarn/install-state.gz 33 | key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} 34 | restore-keys: | 35 | ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} 36 | ${{ runner.os }}-yarn- 37 | 38 | - name: Install dependencies 39 | if: steps.yarn-cache.outputs.cache-hit != 'true' 40 | run: yarn install --immutable 41 | shell: bash 42 | -------------------------------------------------------------------------------- /.github/actions/spelling/advice.md: -------------------------------------------------------------------------------- 1 | 2 |
If the flagged items are :exploding_head: false positives 3 | 4 | If items relate to a ... 5 | * binary file (or some other file you wouldn't want to check at all). 6 | 7 | Please add a file path to the `excludes.txt` file matching the containing file. 8 | 9 | File paths are Perl 5 Regular Expressions - you can [test]( 10 | https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files. 11 | 12 | `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md]( 13 | ../tree/HEAD/README.md) (on whichever branch you're using). 14 | 15 | * well-formed pattern. 16 | 17 | If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it, 18 | try adding it to the `patterns.txt` file. 19 | 20 | Patterns are Perl 5 Regular Expressions - you can [test]( 21 | https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. 22 | 23 | Note that patterns can't match multiline strings. 24 | 25 |
26 | 27 | 28 | :steam_locomotive: If you're seeing this message and your PR is from a branch that doesn't have check-spelling, 29 | please merge to your PR's base branch to get the version configured for your repository. 30 | -------------------------------------------------------------------------------- /.github/actions/spelling/allow.txt: -------------------------------------------------------------------------------- 1 | github 2 | https 3 | ssh 4 | ubuntu 5 | apps 6 | Website 7 | 8 | Bosa 9 | bpm 10 | WWRY 11 | XYWH 12 | regularbeat 13 | IAudio 14 | IBase 15 | IBiquad 16 | IGain 17 | IIR 18 | IOscillator 19 | IStereo 20 | 21 | JSI 22 | Runtimes 23 | shopify 24 | skia 25 | swm 26 | swmansion 27 | rnaa 28 | signalsmith 29 | FLAC 30 | Roadmap 31 | WAV 32 | Worklets 33 | 34 | tada 35 | vec 36 | rnaa 37 | javac 38 | 39 | website 40 | audiodocs 41 | Doxygen 42 | mjs 43 | UMD 44 | -------------------------------------------------------------------------------- /.github/actions/spelling/excludes.txt: -------------------------------------------------------------------------------- 1 | (?:^|/).github/ 2 | (?:^|/).yarn/ 3 | -------------------------------------------------------------------------------- /.github/actions/spelling/only.txt: -------------------------------------------------------------------------------- 1 | \.md$ 2 | -------------------------------------------------------------------------------- /.github/actions/spelling/patterns.txt: -------------------------------------------------------------------------------- 1 | # See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns 2 | 3 | # Questionably acceptable forms of `in to` 4 | # Personally, I prefer `log into`, but people object 5 | # https://www.tprteaching.com/log-into-log-in-to-login/ 6 | \b(?:[Ll]og|[Ss]ign) in to\b 7 | 8 | # to opt in 9 | \bto opt in\b 10 | 11 | # acceptable duplicates 12 | # ls directory listings 13 | [-bcdlpsw](?:[-r][-w][-Ssx]){3}\s+\d+\s+\S+\s+\S+\s+\d+\s+ 14 | # mount 15 | \bmount\s+-t\s+(\w+)\s+\g{-1}\b 16 | # C types and repeated CSS values 17 | \s(auto|center|div|inherit|long|LONG|none|normal|solid|thin|transparent|very)(?: \g{-1})+\s 18 | # C struct 19 | \bstruct\s+(\w+)\s+\g{-1}\b 20 | # go templates 21 | \s(\w+)\s+\g{-1}\s+\`(?:graphql|inject|json|yaml): 22 | # doxygen / javadoc / .net 23 | (?:[\\@](?:brief|groupname|t?param|return|retval)|(?:public|private)(?:\s+static|\s+readonly)*)(?:\s+\{\w+\}|)\s+(\w+)\s+\g{-1}\s 24 | 25 | # Commit message -- Signed-off-by and friends 26 | ^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$ 27 | 28 | # Autogenerated revert commit message 29 | ^This reverts commit [0-9a-f]{40}\.$ 30 | 31 | # ignore long runs of a single character: 32 | \b([A-Za-z])\g{-1}{3,}\b 33 | 34 | # hit-count: 14 file-count: 3 35 | # https/http/file urls 36 | (?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|] 37 | 38 | # hit-count: 5 file-count: 4 39 | # hex digits including css/html color classes: 40 | (?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b 41 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Closes # 4 | 5 | ## Introduced changes 6 | 7 | 8 | 9 | - 10 | 11 | ## Checklist 12 | 13 | 14 | 15 | - [ ] Linked relevant issue 16 | - [ ] Updated relevant documentation 17 | - [ ] Added/Conducted relevant tests 18 | - [ ] Performed self-review of the code 19 | - [ ] Updated Web Audio API coverage 20 | - [ ] Added support for web 21 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | categories: 3 | - title: ⚠️ Breaking Changes 4 | labels: 5 | - breaking-change 6 | - title: 🚀 Features 7 | labels: 8 | - feature 9 | - title: 📖 Docs 10 | labels: 11 | - documentation 12 | - title: 🐛 Bug Fixes 13 | labels: 14 | - bug 15 | - fix 16 | - title: 👨🏻‍🔬 Unstable 17 | labels: 18 | - unstable 19 | - title: Other Changes 20 | labels: 21 | - "*" 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | pull_request: 4 | branches: 5 | - main 6 | merge_group: 7 | types: 8 | - checks_requested 9 | 10 | jobs: 11 | lint: 12 | if: github.event.pull_request.draft == false 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | 18 | - name: Setup 19 | uses: ./.github/actions/setup 20 | 21 | - name: Lint files 22 | run: yarn lint 23 | 24 | - name: Typecheck files 25 | run: yarn typecheck 26 | 27 | build-library: 28 | if: github.event.pull_request.draft == false 29 | runs-on: ubuntu-latest 30 | steps: 31 | - name: Checkout 32 | uses: actions/checkout@v4 33 | 34 | - name: Setup 35 | uses: ./.github/actions/setup 36 | 37 | - name: Build package 38 | run: yarn build 39 | -------------------------------------------------------------------------------- /.github/workflows/publish-docs.yml: -------------------------------------------------------------------------------- 1 | name: build audio api docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - docsprod 7 | paths: 8 | - packages/audiodocs/** 9 | workflow_dispatch: 10 | 11 | permissions: 12 | contents: read 13 | pages: write 14 | id-token: write 15 | 16 | concurrency: 17 | group: 'pages' 18 | cancel-in-progress: false 19 | 20 | jobs: 21 | publish: 22 | if: github.repository == 'software-mansion/react-native-audio-api' 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout repo 26 | uses: actions/checkout@v4 27 | 28 | - name: Setup Node 29 | uses: actions/setup-node@v4 30 | 31 | - name: Setup Yarn 32 | uses: mskelton/setup-yarn@v2 33 | 34 | - name: Install dependencies and build the docs 35 | run: | 36 | cd packages/audiodocs 37 | yarn 38 | yarn build 39 | 40 | - name: Upload build files 41 | uses: actions/upload-pages-artifact@v3 42 | with: 43 | path: packages/audiodocs/build 44 | 45 | - name: Setup Pages 46 | uses: actions/configure-pages@v5 47 | 48 | - name: Recrawl search index 49 | run: | 50 | curl -X POST https://crawler.algolia.com/api/1/crawlers/${{ secrets.CRAWLER_ID }}/reindex \ 51 | -H "Content-Type: application/json" \ 52 | -u ${{ secrets.CRAWLER_USER_ID }}:${{ secrets.CRAWLER_API_KEY }} 53 | 54 | - name: Deploy to Github Pages 55 | uses: actions/deploy-pages@v4 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | .xcode.env.local 33 | 34 | # Android/IJ 35 | # 36 | .classpath 37 | .cxx 38 | .gradle 39 | .idea 40 | .project 41 | .settings 42 | local.properties 43 | android.iml 44 | 45 | # Cocoapods 46 | # 47 | apps/**/ios/Pods 48 | 49 | # Ruby 50 | apps/**/vendor/ 51 | 52 | # node.js 53 | # 54 | node_modules/ 55 | npm-debug.log 56 | yarn-debug.log 57 | yarn-error.log 58 | 59 | # BUCK 60 | buck-out/ 61 | \.buckd/ 62 | android/app/libs 63 | android/keystores/debug.keystore 64 | 65 | # Yarn 66 | .yarn/* 67 | !.yarn/patches 68 | !.yarn/plugins 69 | !.yarn/releases 70 | !.yarn/sdks 71 | !.yarn/versions 72 | .yarn/cache 73 | 74 | # Expo 75 | .expo/ 76 | 77 | # Turborepo 78 | .turbo/ 79 | 80 | packages/react-native-audio-api/lib 81 | react-native-audio-api*.tgz 82 | 83 | # Android 84 | .kotlin 85 | 86 | 87 | # Envs 88 | .env 89 | 90 | compile_commands.json 91 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v20.11.1 2 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | compressionLevel: mixed 2 | 3 | enableGlobalCache: false 4 | 5 | nodeLinker: node-modules 6 | 7 | yarnPath: .yarn/releases/yarn-4.5.0.cjs 8 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | This project contains source code copied from Webkit implementation, which mixes BSD 2 clause and BSD 3 clause with copyrights in specific files held by the following organizations: 2 | 3 | - Google Inc. 4 | - Apple Inc. 5 | 6 | Individual files retain the original copyright notice, but not the full license text. 7 | 8 | WebKit, 2 Clause BSD 9 | Copyright (c) The WebKit Authors 10 | [https://github.com/WebKit/webkit](https://github.com/WebKit/webkit) 11 | 12 | WebKit, 3 Clause BSD 13 | Copyright (c) The WebKit Authors 14 | [https://github.com/WebKit/webkit](https://github.com/WebKit/webkit) 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Software Mansion 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /apps/common-app/index.ts: -------------------------------------------------------------------------------- 1 | import App from './src/App'; 2 | 3 | export default App; 4 | -------------------------------------------------------------------------------- /apps/common-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "common-app", 3 | "version": "0.0.1", 4 | "private": true, 5 | "peerDependencies": { 6 | "react": "*", 7 | "react-native": "*" 8 | }, 9 | "dependencies": { 10 | "@react-native-vector-icons/common": "^11.0.0", 11 | "@react-native-vector-icons/icomoon": "^0.0.1", 12 | "@react-navigation/native": "^7.0.15", 13 | "@react-navigation/native-stack": "^7.2.1", 14 | "@react-navigation/stack": "^7.1.2", 15 | "@shopify/react-native-skia": "1.11.11", 16 | "react-native-audio-api": "workspace:*", 17 | "react-native-dotenv": "3.4.11", 18 | "react-native-gesture-handler": "2.24.0", 19 | "react-native-reanimated": "3.17.1", 20 | "react-native-safe-area-context": "5.3.0", 21 | "react-native-screens": "4.9.1" 22 | }, 23 | "devDependencies": { 24 | "@babel/core": "^7.25.2", 25 | "@babel/preset-env": "^7.25.2", 26 | "@babel/runtime": "^7.25.0", 27 | "@react-native/babel-preset": "0.77.1", 28 | "@react-native/eslint-config": "0.77.1", 29 | "@react-native/metro-config": "0.77.1", 30 | "@react-native/typescript-config": "0.77.1", 31 | "@types/jest": "^29.5.13", 32 | "@types/react": "^18.2.6", 33 | "@types/react-test-renderer": "^18.0.0", 34 | "eslint": "^8.57.0", 35 | "jest": "^29.6.3", 36 | "prettier": "^3.3.3", 37 | "react": "18.3.1", 38 | "react-native": "0.77.1", 39 | "react-test-renderer": "18.3.1", 40 | "typescript": "~5.3.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /apps/common-app/scripts/dependencies.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | /** 4 | * @param {Object} dependencies 5 | * @param {Set} exclude 6 | */ 7 | function resolveDependencies(dependencies = {}, exclude) { 8 | return Object.fromEntries( 9 | Object.keys(dependencies) 10 | .filter((name) => !exclude.has(name)) 11 | .map((name) => [ 12 | name, 13 | { root: path.resolve(__dirname, `../../../node_modules/${name}`) }, 14 | ]) 15 | ); 16 | } 17 | 18 | /** 19 | * This function will return the dependencies from the common-app package that 20 | * aren't listed in the current app's package.json 21 | * 22 | * @param {string} currentAppDir - The current app directory (e.g. __dirname) 23 | * @param {string[]} exclude - The dependencies to exclude from the common-app 24 | */ 25 | function getDependencies(currentAppDir = '.', exclude = []) { 26 | const commonAppDir = path.resolve(__dirname, '..'); 27 | const commonAppPkg = require(path.resolve(commonAppDir, 'package.json')); 28 | 29 | const currentAppPkg = require(path.resolve(currentAppDir, 'package.json')); 30 | 31 | const excludedDependencies = new Set([ 32 | ...Object.keys(currentAppPkg.devDependencies), 33 | ...Object.keys(currentAppPkg.dependencies), 34 | ...exclude, 35 | ]); 36 | 37 | return { 38 | // Get all common-app dependencies that aren't already in the current app 39 | ...resolveDependencies(commonAppPkg.devDependencies, excludedDependencies), 40 | ...resolveDependencies(commonAppPkg.dependencies, excludedDependencies), 41 | }; 42 | } 43 | 44 | module.exports = { 45 | getDependencies, 46 | }; 47 | -------------------------------------------------------------------------------- /apps/common-app/src/components/BGGradient.tsx: -------------------------------------------------------------------------------- 1 | import React, { useCallback, useState } from 'react'; 2 | import { LayoutChangeEvent, StyleSheet, View } from 'react-native'; 3 | import { vec, Rect, Canvas, RadialGradient } from '@shopify/react-native-skia'; 4 | 5 | import { colors } from '../styles'; 6 | 7 | const BGGradient = () => { 8 | const [size, setSize] = useState({ width: 0, height: 0 }); 9 | 10 | const onWrapperLayout = useCallback((event: LayoutChangeEvent) => { 11 | setSize({ 12 | width: event.nativeEvent.layout.width, 13 | height: event.nativeEvent.layout.height, 14 | }); 15 | }, []); 16 | 17 | return ( 18 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | ); 30 | }; 31 | 32 | export default BGGradient; 33 | 34 | const styles = StyleSheet.create({ 35 | wrapper: { 36 | position: 'absolute', 37 | top: 0, 38 | left: 0, 39 | right: 0, 40 | bottom: 0, 41 | }, 42 | canvas: { 43 | width: '100%', 44 | height: '100%', 45 | }, 46 | }); 47 | -------------------------------------------------------------------------------- /apps/common-app/src/components/Button.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import { Text, Pressable, StyleSheet } from 'react-native'; 3 | 4 | import { colors, layout } from '../styles'; 5 | 6 | interface ButtonProps { 7 | title: string; 8 | onPress: () => void; 9 | disabled?: boolean; 10 | width?: number; 11 | } 12 | 13 | const Button: FC = ({ 14 | title, 15 | onPress, 16 | disabled = false, 17 | width = 100, 18 | }) => { 19 | return ( 20 | [ 24 | styles.button, 25 | { 26 | backgroundColor: pressed ? `${colors.main}88` : colors.main, 27 | opacity: disabled ? 0.5 : 1, 28 | width: width, 29 | }, 30 | ]} 31 | > 32 | {title} 33 | 34 | ); 35 | }; 36 | 37 | const styles = StyleSheet.create({ 38 | button: { 39 | padding: layout.spacing, 40 | borderRadius: layout.radius, 41 | }, 42 | text: { 43 | color: colors.white, 44 | textAlign: 'center', 45 | }, 46 | }); 47 | 48 | export default Button; 49 | -------------------------------------------------------------------------------- /apps/common-app/src/components/Container.tsx: -------------------------------------------------------------------------------- 1 | import React, { PropsWithChildren } from 'react'; 2 | import { SafeAreaView } from 'react-native-safe-area-context'; 3 | import { StyleProp, StyleSheet, ViewStyle } from 'react-native'; 4 | 5 | import BGGradient from './BGGradient'; 6 | import { colors } from '../styles'; 7 | 8 | type ContainerProps = PropsWithChildren<{ 9 | style?: StyleProp; 10 | centered?: boolean; 11 | disablePadding?: boolean; 12 | }>; 13 | 14 | const headerPadding = 120; // eyeballed 15 | 16 | const Container: React.FC = (props) => { 17 | const { children, style, centered, disablePadding } = props; 18 | 19 | return ( 20 | 23 | 24 | {children} 25 | 26 | ); 27 | }; 28 | 29 | export default Container; 30 | 31 | const styles = StyleSheet.create({ 32 | basic: { 33 | flex: 1, 34 | paddingTop: headerPadding, 35 | backgroundColor: colors.background, 36 | }, 37 | padding: { 38 | padding: 24, 39 | }, 40 | centered: { 41 | alignItems: 'center', 42 | justifyContent: 'center', 43 | }, 44 | }); 45 | -------------------------------------------------------------------------------- /apps/common-app/src/components/Icon.tsx: -------------------------------------------------------------------------------- 1 | import createIconSet from '@react-native-vector-icons/icomoon'; 2 | import icoMoonConfig from './icomoonConfig.json'; 3 | 4 | const Icon = createIconSet(icoMoonConfig, 'icomoon'); 5 | 6 | export default Icon; 7 | -------------------------------------------------------------------------------- /apps/common-app/src/components/Spacer.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import { View } from 'react-native'; 3 | 4 | interface SpacerProps { 5 | size: number; 6 | } 7 | 8 | const Vertical: FC = ({ size }) => { 9 | return ; 10 | }; 11 | 12 | const Horizontal: FC = ({ size }) => { 13 | return ; 14 | }; 15 | 16 | export default { Vertical, Horizontal }; 17 | -------------------------------------------------------------------------------- /apps/common-app/src/components/Switch.tsx: -------------------------------------------------------------------------------- 1 | import React, { type FC } from 'react'; 2 | import { StyleSheet, Pressable } from 'react-native'; 3 | import Animated, { 4 | useAnimatedStyle, 5 | withSpring, 6 | withTiming, 7 | } from 'react-native-reanimated'; 8 | 9 | import { colors } from '../styles'; 10 | 11 | interface SwitchProps { 12 | value: boolean; 13 | onValueChange: (value: boolean) => void; 14 | } 15 | 16 | const size = 24; 17 | 18 | const Switch: FC = (props) => { 19 | const { value, onValueChange } = props; 20 | 21 | const onPress = () => { 22 | onValueChange(!value); 23 | }; 24 | 25 | const containerStyle = useAnimatedStyle(() => ({ 26 | backgroundColor: withTiming(value ? colors.main : colors.gray), 27 | })); 28 | 29 | const handleStyle = useAnimatedStyle(() => ({ 30 | transform: [ 31 | { 32 | translateX: withSpring(value ? size : 0), 33 | }, 34 | ], 35 | })); 36 | 37 | return ( 38 | 39 | 40 | 44 | 45 | 46 | ); 47 | }; 48 | 49 | export default Switch; 50 | 51 | const styles = StyleSheet.create({ 52 | container: { 53 | height: size, 54 | width: 2 * size, 55 | alignItems: 'center', 56 | flexDirection: 'row', 57 | padding: size * 0.1, 58 | borderRadius: size / 2, 59 | }, 60 | handle: { 61 | width: size * 0.8, 62 | height: size * 0.8, 63 | borderRadius: size / 2, 64 | backgroundColor: colors.white, 65 | }, 66 | }); 67 | -------------------------------------------------------------------------------- /apps/common-app/src/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Icon } from './Icon'; 2 | export { default as Button } from './Button'; 3 | export { default as Slider } from './Slider'; 4 | export { default as Spacer } from './Spacer'; 5 | export { default as Switch } from './Switch'; 6 | export { default as Select } from './Select'; 7 | export { default as Container } from './Container'; 8 | export { default as BGGradient } from './BGGradient'; 9 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/AudioFile/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './AudioFile'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/AudioVisualizer/FreqTimeChart.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { withCanvas } from './Canvas'; 4 | import Charts from './Charts'; 5 | 6 | interface FreqTimeChartProps { 7 | timeData: Uint8Array; 8 | frequencyData: Uint8Array; 9 | fftSize: number; 10 | frequencyBinCount: number; 11 | } 12 | 13 | const FreqTimeChart: React.FC = (props) => { 14 | const { timeData, frequencyData, fftSize, frequencyBinCount } = props; 15 | 16 | return ( 17 | <> 18 | 23 | 28 | 29 | ); 30 | }; 31 | 32 | export default withCanvas(FreqTimeChart); 33 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/AudioVisualizer/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './AudioVisualizer'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/DrumMachine/constants.ts: -------------------------------------------------------------------------------- 1 | import { Dimensions } from 'react-native'; 2 | import type { InstrumentName, XYPoint } from '../../types'; 3 | 4 | export const screenSize = Dimensions.get('screen'); 5 | export const size = Math.min(screenSize.width, screenSize.height); 6 | 7 | export const padding = 24; 8 | 9 | export const maxSize = 10 | Math.min(screenSize.width, screenSize.height) - padding * 2; 11 | 12 | export const initialBpm = 120; 13 | export const numBeats = 16; 14 | export const noteDensity = 2; 15 | 16 | export const buttonRadius = 8; 17 | 18 | export const cPoint: XYPoint = { 19 | x: size / 2, 20 | y: size / 2, 21 | }; 22 | 23 | export const instruments: InstrumentName[] = ['kick', 'clap', 'hi-hat']; 24 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/DrumMachine/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './DrumMachine'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/DrumMachine/instruments.ts: -------------------------------------------------------------------------------- 1 | import { maxSize } from './constants'; 2 | import type { Instrument } from '../../types'; 3 | 4 | export const HiHat: Instrument = { 5 | name: 'hi-hat', 6 | color: '#38ACDD', 7 | radius: maxSize / 2, 8 | }; 9 | 10 | const Clap: Instrument = { 11 | name: 'clap', 12 | color: '#57B495', 13 | radius: (maxSize / 2) * 0.8, 14 | }; 15 | 16 | const Kick: Instrument = { 17 | name: 'kick', 18 | color: '#FFD61E', 19 | radius: (maxSize / 2) * 0.6, 20 | }; 21 | 22 | const instruments: Array = [HiHat, Clap, Kick]; 23 | 24 | export default instruments; 25 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/Metronome/index.tsx: -------------------------------------------------------------------------------- 1 | export { default } from './Metronome'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/OfflineRendering/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './OfflineRendering'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/Oscillator/index.tsx: -------------------------------------------------------------------------------- 1 | export { default } from './Oscillator'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/Piano/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Piano'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/examples/TextToSpeech/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './TextToSpeech'; 2 | -------------------------------------------------------------------------------- /apps/common-app/src/styles.ts: -------------------------------------------------------------------------------- 1 | import { Dimensions } from 'react-native'; 2 | 3 | const { width } = Dimensions.get('screen'); 4 | 5 | export const layout = { 6 | spacing: 8, 7 | radius: 8, 8 | knobSize: 24, 9 | indicatorSize: 48, 10 | screenWidth: width, 11 | } as const; 12 | 13 | export const colors = { 14 | white: '#ffffff', 15 | main: '#38ACDD', 16 | black: '#000000', 17 | gray: '#d7d7d7', 18 | yellow: '#FFD61E', 19 | 20 | background: '#222222', 21 | backgroundDark: '#1f2020', 22 | backgroundLight: '#333333', 23 | 24 | separator: '#333333', 25 | modalBackdrop: '#00000040', 26 | border: '#999999', 27 | } as const; 28 | -------------------------------------------------------------------------------- /apps/common-app/src/types.ts: -------------------------------------------------------------------------------- 1 | export type InstrumentName = 2 | | 'kick' 3 | | 'clap' 4 | | 'hi-hat' 5 | | 'downbeat' 6 | | 'regularbeat'; 7 | 8 | export interface Instrument { 9 | color: string; 10 | radius: number; 11 | name: InstrumentName; 12 | } 13 | 14 | export interface Touché { 15 | cX: number; 16 | cY: number; 17 | stepIdx: number; 18 | patternIdx: number; 19 | } 20 | 21 | export interface Pattern { 22 | instrumentName: InstrumentName; 23 | steps: Array; 24 | } 25 | 26 | export interface Preset { 27 | name: string; 28 | bpm: number; 29 | pattern: Pattern[]; 30 | } 31 | 32 | export interface XYWHRect { 33 | x: number; 34 | y: number; 35 | width: number; 36 | height: number; 37 | } 38 | 39 | export interface XYPoint { 40 | x: number; 41 | y: number; 42 | } 43 | 44 | export type PlayingInstruments = Record; 45 | -------------------------------------------------------------------------------- /apps/common-app/src/utils/env.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | openAiToken: process.env.OPENAI_API_TOKEN, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/common-app/src/utils/skiUtils.ts: -------------------------------------------------------------------------------- 1 | export function getAngle(stepIdx: number, maxSteps: number) { 2 | 'worklet'; 3 | 4 | return (stepIdx / maxSteps) * Math.PI * 2 - Math.PI / 2; 5 | } 6 | 7 | export function getPointCX(angle: number, radius: number, outerCX: number) { 8 | 'worklet'; 9 | 10 | return Math.cos(angle) * radius + outerCX; 11 | } 12 | 13 | export function getPointCY(angle: number, radius: number, outerCY: number) { 14 | 'worklet'; 15 | 16 | return Math.sin(angle) * radius + outerCY; 17 | } 18 | 19 | export function isPointInCircle( 20 | pX: number, 21 | pY: number, 22 | cX: number, 23 | cY: number, 24 | r: number 25 | ) { 26 | 'worklet'; 27 | 28 | return Math.sqrt((pX - cX) ** 2 + (pY - cY) ** 2) < r; 29 | } 30 | -------------------------------------------------------------------------------- /apps/common-app/src/utils/soundEngines/Kick.ts: -------------------------------------------------------------------------------- 1 | import { AudioContext } from 'react-native-audio-api'; 2 | 3 | import type { SoundEngine } from './SoundEngine'; 4 | 5 | class Kick implements SoundEngine { 6 | public audioContext: AudioContext; 7 | public tone: number; 8 | public decay: number; 9 | public volume: number; 10 | 11 | constructor(audioContext: AudioContext) { 12 | this.audioContext = audioContext; 13 | this.tone = 164; 14 | this.decay = 0.2; 15 | this.volume = 0.95; 16 | } 17 | 18 | play(time: number) { 19 | const oscillator = this.audioContext.createOscillator(); 20 | const gain = this.audioContext.createGain(); 21 | 22 | oscillator.frequency.setValueAtTime(0, time); 23 | oscillator.frequency.setValueAtTime(this.tone, time + 0.01); 24 | oscillator.frequency.exponentialRampToValueAtTime(10, time + this.decay); 25 | 26 | gain.gain.setValueAtTime(0, time); 27 | gain.gain.setValueAtTime(this.volume, time + 0.01); 28 | gain.gain.exponentialRampToValueAtTime(0.001, time + this.decay); 29 | 30 | oscillator.connect(gain); 31 | gain.connect(this.audioContext.destination); 32 | 33 | oscillator.start(time); 34 | oscillator.stop(time + this.decay); 35 | } 36 | } 37 | 38 | export default Kick; 39 | -------------------------------------------------------------------------------- /apps/common-app/src/utils/soundEngines/MetronomeSound.ts: -------------------------------------------------------------------------------- 1 | import { AudioContext } from 'react-native-audio-api'; 2 | 3 | import type { SoundEngine } from './SoundEngine'; 4 | 5 | class MetronomeSound implements SoundEngine { 6 | public audioContext: AudioContext; 7 | public tone: number; 8 | public decay: number; 9 | public volume: number; 10 | 11 | constructor(audioContext: AudioContext, tone: number) { 12 | this.audioContext = audioContext; 13 | this.tone = tone; 14 | this.decay = 0.03; 15 | this.volume = 1; 16 | } 17 | 18 | play(time: number) { 19 | const oscillator = this.audioContext.createOscillator(); 20 | const gain = this.audioContext.createGain(); 21 | 22 | oscillator.frequency.value = this.tone; 23 | 24 | gain.gain.setValueAtTime(this.volume, time); 25 | gain.gain.linearRampToValueAtTime(0.5, time + 0.001); 26 | gain.gain.linearRampToValueAtTime(0.001, time + this.decay); 27 | gain.gain.setValueAtTime(0, time + this.decay + 0.001); 28 | 29 | oscillator.connect(gain); 30 | gain.connect(this.audioContext.destination); 31 | 32 | oscillator.start(time); 33 | oscillator.stop(time + this.decay); 34 | } 35 | } 36 | 37 | export default MetronomeSound; 38 | -------------------------------------------------------------------------------- /apps/common-app/src/utils/soundEngines/SoundEngine.ts: -------------------------------------------------------------------------------- 1 | import { AudioContext } from 'react-native-audio-api'; 2 | 3 | export interface SoundEngine { 4 | audioContext: AudioContext; 5 | tone: number; 6 | decay: number; 7 | volume: number; 8 | play: (time: number) => void; 9 | } 10 | -------------------------------------------------------------------------------- /apps/common-app/src/utils/withSeparators.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | type RenderElement = (element: T, index: number) => ReactNode; 4 | type RenderSeparator = (index: number) => ReactNode; 5 | 6 | export default function withSeparators( 7 | collection: ArrayLike, 8 | renderSeparator: RenderSeparator, 9 | renderElement: RenderElement 10 | ) { 11 | const elements = []; 12 | 13 | for (let i = 0; i < collection.length; i += 1) { 14 | elements.push(renderElement(collection[i], i)); 15 | 16 | if (i < collection.length - 1) { 17 | elements.push(renderSeparator(i)); 18 | } 19 | } 20 | 21 | return elements; 22 | } 23 | -------------------------------------------------------------------------------- /apps/common-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "moduleSuffixes": [".ios", ".android", ".native", ""] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /apps/fabric-example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /apps/fabric-example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native', 4 | }; 5 | -------------------------------------------------------------------------------- /apps/fabric-example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /apps/fabric-example/App.tsx: -------------------------------------------------------------------------------- 1 | import App from 'common-app'; 2 | 3 | export default App; 4 | -------------------------------------------------------------------------------- /apps/fabric-example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby ">= 2.6.10" 5 | 6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures. 7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' 8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' 9 | gem 'xcodeproj', '< 1.26.0' 10 | gem 'concurrent-ruby', '< 1.3.4' 11 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/debug.keystore -------------------------------------------------------------------------------- /apps/fabric-example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/java/com/fabricexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.fabricexample 2 | 3 | import android.Manifest 4 | import android.os.Bundle 5 | import androidx.core.app.ActivityCompat 6 | import com.facebook.react.ReactActivity 7 | import com.facebook.react.ReactActivityDelegate 8 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 9 | import com.facebook.react.defaults.DefaultReactActivityDelegate 10 | 11 | class MainActivity : ReactActivity() { 12 | 13 | /** 14 | * Returns the name of the main component registered from JavaScript. This is used to schedule 15 | * rendering of the component. 16 | */ 17 | override fun getMainComponentName(): String = "FabricExample" 18 | 19 | /** 20 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 21 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 22 | */ 23 | override fun createReactActivityDelegate(): ReactActivityDelegate = 24 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 25 | } 26 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | FabricExample 3 | 4 | -------------------------------------------------------------------------------- /apps/fabric-example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /apps/fabric-example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | buildToolsVersion = "35.0.0" 4 | minSdkVersion = 24 5 | compileSdkVersion = 35 6 | targetSdkVersion = 34 7 | ndkVersion = "27.1.12297006" 8 | kotlinVersion = "2.0.21" 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle") 16 | classpath("com.facebook.react:react-native-gradle-plugin") 17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 18 | } 19 | } 20 | 21 | apply plugin: "com.facebook.react.rootproject" 22 | -------------------------------------------------------------------------------- /apps/fabric-example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /apps/fabric-example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /apps/fabric-example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { includeBuild("../../../node_modules/@react-native/gradle-plugin") } 2 | plugins { id("com.facebook.react.settings") } 3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } 4 | rootProject.name = 'FabricExample' 5 | include ':app' 6 | includeBuild('../../../node_modules/@react-native/gradle-plugin') 7 | -------------------------------------------------------------------------------- /apps/fabric-example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FabricExample", 3 | "displayName": "FabricExample" 4 | } 5 | -------------------------------------------------------------------------------- /apps/fabric-example/assets/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/assets/fonts/icomoon.ttf -------------------------------------------------------------------------------- /apps/fabric-example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (api) { 2 | api.cache(false); 3 | return { 4 | presets: ['module:@react-native/babel-preset'], 5 | plugins: ['react-native-reanimated/plugin', 'module:react-native-dotenv'], 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /apps/fabric-example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /apps/fabric-example/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /apps/fabric-example/ios/FabricExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /apps/fabric-example/ios/FabricExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import React 3 | import React_RCTAppDelegate 4 | import ReactAppDependencyProvider 5 | 6 | @main 7 | class AppDelegate: RCTAppDelegate { 8 | override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 9 | self.moduleName = "FabricExample" 10 | self.dependencyProvider = RCTAppDependencyProvider() 11 | 12 | // You can add your custom initial props in the dictionary below. 13 | // They will be passed down to the ViewController used by React Native. 14 | self.initialProps = [:] 15 | 16 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 17 | } 18 | 19 | override func sourceURL(for bridge: RCTBridge) -> URL? { 20 | self.bundleURL() 21 | } 22 | 23 | override func bundleURL() -> URL? { 24 | #if DEBUG 25 | RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") 26 | #else 27 | Bundle.main.url(forResource: "main", withExtension: "jsbundle") 28 | #endif 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /apps/fabric-example/ios/FabricExample/Images.xcassets/AppIcon.appiconset/AppIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/apps/fabric-example/ios/FabricExample/Images.xcassets/AppIcon.appiconset/AppIcon.png -------------------------------------------------------------------------------- /apps/fabric-example/ios/FabricExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "AppIcon.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /apps/fabric-example/ios/FabricExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /apps/fabric-example/ios/FabricExample/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryFileTimestamp 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C617.1 13 | 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryUserDefaults 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | CA92.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyCollectedDataTypes 33 | 34 | NSPrivacyTracking 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /apps/fabric-example/ios/Podfile: -------------------------------------------------------------------------------- 1 | ENV['RCT_NEW_ARCH_ENABLED'] = '1' 2 | 3 | # Resolve react_native_pods.rb with node to allow for hoisting 4 | require Pod::Executable.execute_command('node', ['-p', 5 | 'require.resolve( 6 | "react-native/scripts/react_native_pods.rb", 7 | {paths: [process.argv[1]]}, 8 | )', __dir__]).strip 9 | 10 | platform :ios, min_ios_version_supported 11 | prepare_react_native_project! 12 | 13 | linkage = ENV['USE_FRAMEWORKS'] 14 | if linkage != nil 15 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 16 | use_frameworks! :linkage => linkage.to_sym 17 | end 18 | 19 | target 'FabricExample' do 20 | config = use_native_modules! 21 | 22 | use_react_native!( 23 | :path => config[:reactNativePath], 24 | # An absolute path to your application root. 25 | :app_path => "#{Pod::Config.instance.installation_root}/.." 26 | ) 27 | 28 | post_install do |installer| 29 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 30 | react_native_post_install( 31 | installer, 32 | config[:reactNativePath], 33 | :mac_catalyst_enabled => false, 34 | # :ccache_enabled => true 35 | ) 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /apps/fabric-example/metro.config.js: -------------------------------------------------------------------------------- 1 | const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); 2 | const { 3 | wrapWithAudioAPIMetroConfig, 4 | } = require('react-native-audio-api/metro-config'); 5 | 6 | const path = require('path'); 7 | 8 | const root = path.resolve(__dirname, '../..'); 9 | 10 | /** 11 | * Metro configuration https://reactnative.dev/docs/metro 12 | * 13 | * @type {import('@react-native/metro-config').MetroConfig} 14 | */ 15 | const config = { 16 | watchFolders: [root], 17 | }; 18 | 19 | module.exports = wrapWithAudioAPIMetroConfig( 20 | mergeConfig(getDefaultConfig(__dirname), config), 21 | ); 22 | -------------------------------------------------------------------------------- /apps/fabric-example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fabric-example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "lint": "eslint .", 9 | "start": "react-native start", 10 | "test": "jest" 11 | }, 12 | "dependencies": { 13 | "common-app": "workspace:*", 14 | "react": "18.3.1", 15 | "react-native": "0.77.1" 16 | }, 17 | "devDependencies": { 18 | "@react-native-community/cli": "15.0.1", 19 | "@react-native-community/cli-platform-android": "15.0.1", 20 | "@react-native-community/cli-platform-ios": "15.0.1" 21 | }, 22 | "engines": { 23 | "node": ">=18" 24 | }, 25 | "reactNativeVectorIcons": { 26 | "fontDir": "./assets/fonts" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /apps/fabric-example/react-native.config.js: -------------------------------------------------------------------------------- 1 | /** This file is required to properly resolve native dependencies */ 2 | const { getDependencies } = require('../common-app/scripts/dependencies'); 3 | 4 | const dependencies = getDependencies(__dirname); 5 | 6 | module.exports = { 7 | dependencies, 8 | assets: ['./assets/fonts/'], 9 | }; 10 | -------------------------------------------------------------------------------- /apps/fabric-example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "moduleSuffixes": [".ios", ".android", ".native", ""], 6 | "paths": { 7 | "@/*": ["../common-app/src/*"] 8 | } 9 | }, 10 | "exclude": ["metro.config.js", "android", "ios", ".bundle", "node_modules"] 11 | } 12 | -------------------------------------------------------------------------------- /assets/react-native-audio-api-gh-cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/software-mansion/react-native-audio-api/cddba015d56caf285ae8bbcbbee4f0a6daddf451/assets/react-native-audio-api-gh-cover.png -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | parallel: true 3 | commands: 4 | format: 5 | run: yarn format 6 | lint: 7 | run: yarn lint 8 | types: 9 | glob: '*.{js,ts,jsx,tsx}' 10 | run: yarn typecheck 11 | commit-msg: 12 | parallel: true 13 | commands: 14 | commitlint: 15 | run: npx commitlint --edit 16 | -------------------------------------------------------------------------------- /packages/audiodocs/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@babel/eslint-parser", 3 | "parserOptions": { 4 | "babelOptions": { 5 | "presets": ["@babel/preset-react"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/audiodocs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | 22 | # Yarn 23 | .yarn/* 24 | !.yarn/patches 25 | !.yarn/plugins 26 | !.yarn/releases 27 | !.yarn/sdks 28 | !.yarn/versions 29 | .yarn/cache 30 | -------------------------------------------------------------------------------- /packages/audiodocs/.yarnrc.yml: -------------------------------------------------------------------------------- 1 | yarnPath: .yarn/releases/yarn-1.22.22.cjs 2 | -------------------------------------------------------------------------------- /packages/audiodocs/README.md: -------------------------------------------------------------------------------- 1 | # React Native Audio API documentation 2 | 3 | The docs are available at (https://software-mansion.github.io/react-native-audio-api/)(https://software-mansion.github.io/react-native-audio-api/) 4 | -------------------------------------------------------------------------------- /packages/audiodocs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/analysis/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Analysis", 3 | "position": 7, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/core/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Core", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/core/audio-context.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # AudioContext 6 | 7 | The `AudioContext` interface inherits from [`BaseAudioContext`](/core/base-audio-context). 8 | It is responsible for supervising and managing audio-processing graph. 9 | 10 | ## Constructor 11 | 12 | `new AudioContext()` 13 | 14 | [`new AudioContext(options: AudioContextOptions)`](/types/audio-context-options) 15 | 16 | #### Errors 17 | 18 | | Error type | Description | 19 | | :---: | :---- | 20 | | `NotSupportedError` | `sampleRate` is outside the nominal range [8000, 96000]. | 21 | 22 | ## Methods 23 | 24 | ### `close` 25 | 26 | The above method lets you close the audio context, releasing any system audio resources that it uses. 27 | 28 | #### Returns `Promise`. 29 | 30 | ### `suspend` 31 | 32 | The above method lets you suspend time progression in the audio context. 33 | It is useful when your application will not use audio for a while. 34 | 35 | #### Returns `Promise`. 36 | 37 | ### `resume` 38 | 39 | The above method lets resume time progression in audio context that previously has been suspended. 40 | 41 | #### Returns `Promise`. 42 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/destinations/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Destinations", 3 | "position": 8, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/effects/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Effects", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/effects/stereo-panner-node.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | import AudioNodePropsTable from "@site/src/components/AudioNodePropsTable" 6 | import { ReadOnly } from '@site/src/components/Badges'; 7 | 8 | # StereoPannerNode 9 | 10 | The `StereoPannerNode` interface represents the change in ratio between two outputing channels (f. e. left and right speaker). 11 | 12 | #### [`AudioNode`](/core/audio-node#read-only-properties) properties 13 | 14 | 15 | 16 | ## Constructor 17 | 18 | [`BaseAudioContext.createStereoPanner()`](/core/base-audio-context#createstereopanner) 19 | 20 | ## Properties 21 | 22 | | Name | Type | Default value | Description | 23 | | :----: | :----: | :-------- | :------ | 24 | | `pan` | [`AudioParam`](/core/audio-param) | 0 | [`a-rate`](/core/audio-param#a-rate-vs-k-rate) `AudioParam` representing value of pan to apply. | 25 | 26 | ## Remarks 27 | 28 | #### `pan` 29 | - Nominal range is -1 (only left channel) to 1 (only right channel). 30 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/fundamentals/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Fundamentals", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/guides/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Guides", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/other/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Other", 3 | "position": 10, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/other/audio-api-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: audio-api-plugin 3 | sidebar_label: Audio API Expo plugin 4 | sidebar_position: 3 5 | --- 6 | 7 | # 🚧 Audio API Expo plugin 🚧 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/other/compatibility.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: compatibility 3 | sidebar_label: RN Compatibility 4 | sidebar_position: 1 5 | --- 6 | 7 | import { Yes, No, Version, Spacer } from '@site/src/components/Compatibility'; 8 | 9 | # React Native compatibility table 10 | 11 | ### Supported React Native versions on [the New Architecture](https://reactnative.dev/docs/the-new-architecture/landing-page) (Fabric) 12 | 13 |
14 | 15 | | | 0.74 | 0.75 | 0.76 | 0.77 | 0.78 | 16 | | ----------------------------------- | ----- | ----- | ----- | ----- | ----- | 17 | | | | | | | | 18 | | | | | | | | 19 | | | | | | | | 20 | | | | | | | | 21 | 22 |
23 | 24 | ### Supported React Native versions on the Old Architecture (Paper) 25 | 26 |
27 | 28 | | | 0.74 | 0.75 | 0.76 | 0.77 | 29 | | ----------------------------------- | ----- | ----- | ----- | ----- | 30 | | | | | | | 31 | | | | | | | 32 | | | | | | | 33 | | | | | | | 34 | 35 |
36 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/sources/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Sources", 3 | "position": 4, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/spatialization/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Spatialization", 3 | "position": 6, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/system/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "System", 3 | "position": 6, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Types", 3 | "position": 9, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/audio-buffer-source-node-options.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # AudioBufferSourceNodeOptions 6 | 7 | `AudioBufferSourceNodeOptions` is a dictionary object specifies if pitch correction algorithm has to be available. 8 | 9 | ```jsx 10 | interface AudioBufferSourceNodeOptions { 11 | pitchCorrection: boolean 12 | } 13 | ``` 14 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/audio-context-options.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # AudioContextOptions 6 | 7 | `AudioContextOptions` is a dictionary object specifies sample rate for the new context. 8 | 9 | ```jsx 10 | interface AudioContextOptions { 11 | sampleRate: number; 12 | } 13 | ``` 14 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/channel-count-mode.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # ChannelCountMode 6 | 7 | `ChannelCountMode` type determines how the number of input channels affects the number of output channels in an audio node. 8 | 9 | **Acceptable values:** 10 | - `max` 11 | 12 | The number of channels is equal to the maximum number of channels of all connections. In this case, `channelCount` is ignored and only up-mixing happens. 13 | 14 | - `clamped-max` 15 | 16 | The number of channels is equal to the maximum number of channels of all connections, clamped to the value of `channelCount`(serves as the maximum permissible value). 17 | 18 | - `explicit` 19 | 20 | The number of channels is defined by the value of `channelCount`. 21 | 22 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/context-state.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # ContextState 6 | 7 | `ContextState` type represents state of the [`BaseAudioContext`](/core/base-audio-context). 8 | 9 | **Acceptable values:** 10 | - `suspended` 11 | 12 | The audio context has been suspended (with one of [`suspend`](/core/audio-context#suspend) or `OfflineAudioContext.suspend`). 13 | 14 | - `running` 15 | 16 | The audio context is running normally. 17 | 18 | - `closed` 19 | 20 | The audio context has been closed (with [`close`](/core/audio-context#close) method). 21 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/oscillator-type.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # OscillatorType 6 | 7 | `OscillatorType` is a string that specifies shape of an oscillator wave 8 | 9 | ```jsx 10 | type OscillatorType = 11 | | 'sine' 12 | | 'square' 13 | | 'sawtooth' 14 | | 'triangle' 15 | | 'custom'; 16 | ``` 17 | 18 | Below you can see possible names with shapes corresponding to them. 19 | ![](/img/oscillator-waves.png) 20 | 21 | ## `custom` 22 | 23 | This value can't be set explicitly, but it allows user to set any shape. See [`setPeriodicWave`](/sources/oscillator-node#setperiodicwave) for reference. 24 | 25 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/periodic-wave-constraints.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | --- 4 | 5 | # PeriodicWaveConstraints 6 | 7 | `PeriodicWaveConstraints` is a dictionary object specifies whether normalization should be disabled during creating periodic wave. If not specified normalization is enabled. 8 | If normalized, periodic wave will have maximum peak value of 1 and minimum peak value of -1. 9 | 10 | ```jsx 11 | interface PeriodicWaveConstraints { 12 | disableNormalization: boolean; 13 | } 14 | ``` 15 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/types/window-type.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 8 3 | --- 4 | 5 | # WindowType 6 | 7 | `WindowType` type specifies which [window function](https://en.wikipedia.org/wiki/Window_function) is applied when extracting frequency data. 8 | 9 | **Acceptable values:** 10 | - `blackman` 11 | 12 | Set [Blackman window](https://www.sciencedirect.com/topics/engineering/blackman-window) as window function. 13 | 14 | - `hann` 15 | 16 | Set [Hanning window](https://www.sciencedirect.com/topics/engineering/hanning-window) as window function. 17 | 18 | :::caution 19 | 20 | On `Web`, the value of `window` is permanently `'blackman'`, and it cannot be set like on the `Android` or `iOS`. 21 | 22 | ::: 23 | -------------------------------------------------------------------------------- /packages/audiodocs/docs/worklets/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Worklets", 3 | "position": 8, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/audiodocs/prettier.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Config} */ 2 | module.exports = { 3 | plugins: ['prettier-plugin-jsdoc'], 4 | bracketSameLine: true, 5 | printWidth: 80, 6 | singleQuote: true, 7 | trailingComma: 'es5', 8 | tabWidth: 2, 9 | arrowParens: 'always', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/audiodocs/sidebars.js: -------------------------------------------------------------------------------- 1 | // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) 2 | 3 | /** 4 | * Creating a sidebar enables you to: 5 | - create an ordered group of docs 6 | - render a sidebar for each doc of that group 7 | - provide next/previous navigation 8 | 9 | The sidebars can be generated from the filesystem, or explicitly defined here. 10 | 11 | Create as many sidebars as you want. 12 | */ 13 | const sidebars = { 14 | // By default, Docusaurus generates a sidebar from the docs folder structure 15 | tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], 16 | 17 | // But you can create a sidebar manually 18 | /* 19 | tutorialSidebar: [ 20 | 'intro', 21 | 'hello', 22 | { 23 | type: 'category', 24 | label: 'Tutorial', 25 | items: ['tutorial-basics/create-a-document'], 26 | }, 27 | ], 28 | */ 29 | }; 30 | 31 | module.exports = sidebars; 32 | -------------------------------------------------------------------------------- /packages/audiodocs/src/components/AnimableIcon/index.tsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import React, { useEffect, JSX } from 'react'; 3 | import { useColorMode } from '@docusaurus/theme-common'; 4 | 5 | import styles from './styles.module.css'; 6 | 7 | export const Animation = { 8 | FADE_IN_OUT: styles.iconClicked, 9 | }; 10 | 11 | interface Props { 12 | icon: JSX.Element; 13 | iconDark?: JSX.Element; 14 | animation: string; 15 | onClick: ( 16 | actionPerformed: boolean, 17 | setActionPerformed: (ap: boolean) => void 18 | ) => void; 19 | } 20 | 21 | const AnimableIcon = ({ 22 | icon, 23 | iconDark, 24 | animation = Animation.FADE_IN_OUT, 25 | onClick, 26 | }: Props): JSX.Element => { 27 | const { colorMode } = useColorMode(); 28 | const [actionPerformed, setActionPerformed] = React.useState(false); 29 | 30 | useEffect(() => { 31 | const timeout = setTimeout(() => setActionPerformed(() => false), 1000); 32 | return () => clearTimeout(timeout); 33 | }, [actionPerformed]); 34 | 35 | return ( 36 |
onClick(actionPerformed, setActionPerformed)} 38 | className={clsx(styles.actionIcon, actionPerformed && animation)} 39 | > 40 | {colorMode === 'light' ? icon : iconDark || icon} 41 |
42 | ); 43 | }; 44 | 45 | export default AnimableIcon; 46 | -------------------------------------------------------------------------------- /packages/audiodocs/src/components/AnimableIcon/styles.module.css: -------------------------------------------------------------------------------- 1 | .actionIcon { 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | 6 | padding: 0.25em; 7 | cursor: pointer; 8 | 9 | /* Border applied to omit enlarging icon during the animation. */ 10 | border: 1px solid transparent; 11 | border-radius: 3px; 12 | } 13 | 14 | .iconClicked { 15 | animation: 1s iconClick; 16 | } 17 | 18 | @keyframes iconClick { 19 | 0% { 20 | border: 1px solid var(--swm-interactive-copy-button-off); 21 | } 22 | 50% { 23 | border: 1px solid var(--swm-interactive-copy-button-on); 24 | } 25 | 100% { 26 | border: 1px solid var(--swm-interactive-copy-button-off); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/audiodocs/src/components/AudioNodePropsTable/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | type ChannelCountMode = 'max' | 'clamped-max' | 'explicit'; 4 | type ChannelInterpretation = 'speakers' | 'discrete'; 5 | 6 | interface AudioNodePropsTableProps { 7 | numberOfInputs: number; 8 | numberOfOutputs: number; 9 | channelCount: number | string; 10 | channelCountMode: ChannelCountMode; 11 | channelInterpretation: ChannelInterpretation; 12 | } 13 | 14 | const AudioNodePropsTable = ({ 15 | numberOfInputs, 16 | numberOfOutputs, 17 | channelCount, 18 | channelCountMode, 19 | channelInterpretation, 20 | }: AudioNodePropsTableProps) => { 21 | const props = [ 22 | { label: "Number of inputs", value: numberOfInputs }, 23 | { label: "Number of outputs", value: numberOfOutputs }, 24 | { label: "Channel count", value: channelCount }, 25 | { label: "Channel count mode", value: channelCountMode }, 26 | { label: "Channel interpretation", value: channelInterpretation }, 27 | ]; 28 | 29 | return ( 30 | 37 | 38 | {props.map((prop, index) => ( 39 | 40 | 47 | 54 | 55 | ))} 56 | 57 |
45 | {prop.label} 46 | 52 | {prop.value} 53 |
58 | ); 59 | }; 60 | 61 | export default AudioNodePropsTable; 62 | -------------------------------------------------------------------------------- /packages/audiodocs/src/components/Badges/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styles from './styles.module.css'; 3 | 4 | export function Optional({ footnote }) { 5 | return
Optional{footnote ? '*' : ''}
; 6 | } 7 | 8 | export function ReadOnly({ footnote }) { 9 | return
Read only{footnote ? '*' : ''}
; 10 | } 11 | 12 | export function Overridden({ footnote }) { 13 | return
Overridden{footnote ? '*' : ''}
; 14 | } 15 | 16 | export function OnlyiOS({ footnote }) { 17 | return
iOS only{footnote ? '*' : ''}
; 18 | } 19 | 20 | export function Experimental({ footnote }) { 21 | return
Experimental{footnote ? '*' : ''}
; 22 | } 23 | -------------------------------------------------------------------------------- /packages/audiodocs/src/components/Badges/styles.module.css: -------------------------------------------------------------------------------- 1 | .badge { 2 | display: inline-block; 3 | border: 1px solid #ccc; 4 | color: var(--ifm-font-color-base); 5 | border-radius: 4rem; 6 | font-size: 12px; 7 | font-weight: 400; 8 | padding: 0.125rem 0.375rem; 9 | white-space: nowrap; 10 | margin: 0 0.25rem; 11 | } 12 | 13 | .experimental { 14 | color: var(--swm-sidebar-label-text-experimental); 15 | background-color: var(--swm-sidebar-label-background-experimental); 16 | } 17 | -------------------------------------------------------------------------------- /packages/audiodocs/src/components/Compatibility/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styles from './styles.module.css'; 3 | 4 | export function Yes() { 5 | return
yes
; 6 | } 7 | 8 | export function No() { 9 | return
no
; 10 | } 11 | 12 | interface VersionProps { 13 | version: string; 14 | } 15 | 16 | export function Version({ version }: VersionProps) { 17 | return
{version}
; 18 | } 19 | 20 | export function Spacer() { 21 | return
; 22 | } 23 | -------------------------------------------------------------------------------- /packages/audiodocs/src/components/Compatibility/styles.module.css: -------------------------------------------------------------------------------- 1 | .supported { 2 | color: var(--swm-compatibility-text-color); 3 | background-color: var(--swm-compatibility-supported-background); 4 | text-align: center; 5 | text-transform: capitalize; 6 | padding: 12px; 7 | } 8 | 9 | .notSupported { 10 | color: var(--swm-compatibility-text-color); 11 | background-color: var(--swm-compatibility-not-supported-background); 12 | text-align: center; 13 | text-transform: capitalize; 14 | padding: 12px; 15 | } 16 | 17 | .version { 18 | font-weight: bold; 19 | text-align: center; 20 | padding: 12px; 21 | } 22 | 23 | .spacer { 24 | padding-top: 10px; 25 | } 26 | -------------------------------------------------------------------------------- /packages/audiodocs/src/css/custom.css: -------------------------------------------------------------------------------- 1 | @import 'colors.css'; 2 | @import 'typography.css'; 3 | @import 'overrides.css'; 4 | -------------------------------------------------------------------------------- /packages/audiodocs/src/examples/LetsMakeSomeNoise/Component.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Button, View } from 'react-native'; 3 | import { AudioContext } from 'react-native-audio-api'; 4 | 5 | export default function App() { 6 | const handlePlay = async () => { 7 | const audioContext = new AudioContext(); 8 | 9 | const audioBuffer = await fetch('/react-native-audio-api/audio/music/example-music-01.mp3') 10 | .then((response) => response.arrayBuffer()) 11 | .then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer)); 12 | 13 | const playerNode = await audioContext.createBufferSource(); 14 | playerNode.buffer = audioBuffer; 15 | 16 | playerNode.connect(audioContext.destination); 17 | playerNode.start(audioContext.currentTime); 18 | playerNode.stop(audioContext.currentTime + 10); 19 | }; 20 | 21 | return ( 22 | 23 |