expo-juce
v0.3.1
Published
Realtime DSP w/C++ & JUCE
Maintainers
Readme
expo-juce
Realtime DSP w/C++ & JUCE
Quick Start
Installation
npm install expo-juceiOS Setup
After installing, run:
npx pod-installAndroid Setup
No additional setup required.
Basic Usage
Playing a Tone
import { Button } from 'react-native';
import * as ExpoJuce from 'expo-juce';
function App() {
const playTone = () => {
const frequency = 440; // A4 note (Hz)
const duration = 0.5; // seconds
ExpoJuce.playTone(frequency, duration);
};
return <Button title="Play Tone" onPress={playTone} />;
}Available Functions
hello()- Returns a greeting stringgetApiKey()- Returns the API keyplayTone(frequency: number, duration: number)- Plays a sine wave tone at the specified frequency for the given durationsetValueAsync(value: string)- Async function that emits a change eventPI- Constant value of π
Events
Listen to change events:
import { addChangeListener } from 'expo-juce';
const subscription = addChangeListener((event) => {
console.log('Value changed:', event.value);
});
// Clean up
subscription.remove();Low-Latency Audio
The module is configured for low-latency audio playback:
- 5ms buffer size
- Real-time audio processing thread
- AVAudioEngine on iOS
- Optimized for minimal latency
Development
Running the Example App
cd example
yarn install
yarn ios # or yarn androidBuilding the Module
npm run buildTesting & Distribution
For End Users to Test
Since this is a native module, users cannot test it with Expo Go. You have several options:
Option 1: Expo EAS Build (Recommended)
Install prebuilt version from EAS https://expo.dev/accounts/aaronsmulktis/projects/expo-juce-example/builds/a8f46b6b-60a4-4bfa-98fc-5c5458b45c60
Create a development build that users can install on their devices:
cd example
eas build --profile development --platform iosThis creates a custom development client with your native module. Share the build URL from EAS.
Option 2: TestFlight (iOS)
- Create a production build:
cd example eas build --profile production --platform ios - Submit to TestFlight:
eas submit --platform ios - Invite testers via App Store Connect
Option 3: Internal Distribution (iOS)
- Build an ad-hoc IPA:
cd example/ios xcodebuild -workspace expojuceexample.xcworkspace \ -scheme expojuceexample \ -configuration Release \ -archivePath build/expojuceexample.xcarchive \ archive - Export and share the IPA file
- Users install via device provisioning profiles
Option 4: GitHub Releases
- Build APK/IPA files
- Create a GitHub Release
- Attach builds as release assets
- Add installation instructions in release notes
Note: Native modules require a custom development build. Users cannot simply scan a QR code like with Expo Go.
API documentation
Installation in managed Expo projects
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
Installation in bare React Native projects
For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.
Add the package to your npm dependencies
npm install expo-juceConfigure for iOS
Run npx pod-install after installing the npm package.
Configure for Android
Running the Example App
cd examplecd iosnpx pod-install- Open workspace in XCode
- Update
ENABLE_USER_SCRIPT_SANDBOXINGto NO in Build Settings
Contributing
Contributions are very welcome! Please refer to guidelines described in the contributing guide.
