Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e045715
feat: draft
Nov 11, 2025
736a2de
fix: nitpicks
Nov 11, 2025
8814752
feat: working for none oversample
Nov 11, 2025
47f4543
ci: lint
Nov 11, 2025
7abeec3
feat: implemented up and down sampling
Nov 12, 2025
5a0e0f8
feat: added web support
Nov 12, 2025
dfd8482
docs: draft
Nov 12, 2025
127a972
chore: tests draft for wave shaper and resampler
Nov 12, 2025
6b8f30d
refactor: few nitpicks
Nov 13, 2025
60e138b
feat: improvements
Nov 21, 2025
dbb0985
fix: nitpick
Nov 21, 2025
16c79b5
ci: format
Nov 21, 2025
42d7348
Merge branch 'main' into feat/wave-shaper
Nov 21, 2025
2f19187
ci: format
Nov 21, 2025
7b76db6
ci: format
Nov 21, 2025
baf7a5a
chore: update Web Audio API coverage table
Nov 21, 2025
fff55a6
fix: fixed tests
Nov 21, 2025
97d047f
ci: format
Nov 21, 2025
2eca4c7
refactor: simd optimizations
Nov 22, 2025
5ff8d43
test: added tests
Nov 22, 2025
5988060
feat: added example for wave shaper node
Nov 22, 2025
7284cdc
docs: finished docs
Nov 22, 2025
1af8d2f
fix: nitpicks
Nov 22, 2025
c349d9c
fix: fixed assignment of null to WaveShaperNode curve property
Nov 27, 2025
89d74bb
refactor: added requested changes
Nov 27, 2025
0ed84c4
refactor: requested changes applied and improvements made
Nov 28, 2025
3892145
fix: nitpick
Nov 28, 2025
04a46df
fix: nitpick
Nov 28, 2025
3b3a61a
test: part of resampler tests
Nov 28, 2025
d45ac50
test: implemented resamplers process testa
Dec 1, 2025
94ea611
ci: lint
Dec 1, 2025
b24deb3
Merge branch 'main' into feat/wave-shaper
Dec 2, 2025
0ae8af3
chore: requested changes
Dec 3, 2025
d49bdce
Merge branch 'main' into feat/wave-shaper
Dec 3, 2025
4cd5588
chore: requested changes
Dec 4, 2025
655454f
Merge branch 'main' into feat/wave-shaper
Dec 13, 2025
1b617f8
fix: always processing RENDER_QUANTUM_SIZE frames in WaveShaperNode
Dec 13, 2025
61cae85
ci: lint
Dec 13, 2025
6cf8b8d
feat: added guitar padel example
Dec 13, 2025
07862c6
fix: fixed tests
Dec 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions apps/common-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const HomeScreen: FC = () => {
style={({ pressed }) => [
styles.button,
{ borderStyle: pressed ? 'solid' : 'dashed' },
]}
>
]}>
<Text style={styles.title}>{item.title}</Text>
<Text style={styles.subtitle}>{item.subtitle}</Text>
</Pressable>
Expand Down Expand Up @@ -64,8 +63,7 @@ const App: FC = () => {
headerTintColor: colors.white,
headerBackTitle: ' ',
headerBackAccessibilityLabel: 'Go back',
}}
>
}}>
<Stack.Screen
name="Home"
component={HomeScreen}
Expand Down
7 changes: 6 additions & 1 deletion apps/common-app/src/components/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ const Container: React.FC<ContainerProps> = (props) => {
return (
<SafeAreaView
edges={['bottom', 'left', 'right']}
style={[styles.basic, centered && styles.centered, !disablePadding && styles.padding, style]}>
style={[
styles.basic,
centered && styles.centered,
!disablePadding && styles.padding,
style,
]}>
<BGGradient />
{children}
</SafeAreaView>
Expand Down
119 changes: 119 additions & 0 deletions apps/common-app/src/components/VerticalSlider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import React, { useEffect } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
import Animated, {
useSharedValue,
useAnimatedStyle,
} from 'react-native-reanimated';
import { scheduleOnRN } from 'react-native-worklets';

const SLIDER_HEIGHT = 150;
const THUMB_SIZE = 30;
const TRACK_HEIGHT = SLIDER_HEIGHT - THUMB_SIZE;

interface VerticalSliderProps {
label: string;
value: number;
onValueChange: (val: number) => void;
}

const VerticalSlider: React.FC<VerticalSliderProps> = ({
label,
value,
onValueChange,
}) => {
const progress = useSharedValue(value);
const startValue = useSharedValue(0);

useEffect(() => {
progress.value = value;
}, [value, progress]);

const gesture = Gesture.Pan()
.onStart(() => {
'worklet';
startValue.value = progress.value;
})
.onUpdate((e) => {
'worklet';
const change = -e.translationY / TRACK_HEIGHT;
const newValue = startValue.value + change;
progress.value = Math.min(Math.max(newValue, 0), 1);
scheduleOnRN(onValueChange, progress.value);
});

const thumbStyle = useAnimatedStyle(() => {
const translateY = (1 - progress.value) * TRACK_HEIGHT;
return {
transform: [{ translateY }],
};
});

return (
<View style={styles.sliderContainer}>
<Text style={styles.sliderLabel}>{label}</Text>
<View style={styles.sliderTrackContainer}>
<View style={styles.sliderTrack} />
<GestureDetector gesture={gesture}>
<Animated.View style={[styles.sliderThumbHitArea, thumbStyle]}>
<View style={styles.sliderThumb} />
</Animated.View>
</GestureDetector>
</View>
<Text style={styles.sliderValue}>{(value * 100).toFixed(0)}</Text>
</View>
);
};

const styles = StyleSheet.create({
sliderContainer: {
alignItems: 'center',
gap: 5,
height: SLIDER_HEIGHT + 40,
},
sliderLabel: {
fontWeight: 'bold',
fontSize: 12,
color: '#333',
},
sliderTrackContainer: {
width: 40,
height: SLIDER_HEIGHT,
justifyContent: 'center',
alignItems: 'center',
},
sliderTrack: {
position: 'absolute',
width: 4,
height: '100%',
backgroundColor: '#111',
borderRadius: 2,
},
sliderThumbHitArea: {
position: 'absolute',
top: 0,
width: 40,
height: THUMB_SIZE,
justifyContent: 'center',
alignItems: 'center',
},
sliderThumb: {
width: 30,
height: 15,
backgroundColor: '#222',
borderWidth: 1,
borderColor: '#fff',
borderRadius: 2,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.5,
shadowRadius: 2,
},
sliderValue: {
fontSize: 10,
color: '#555',
fontVariant: ['tabular-nums'],
},
});

export default VerticalSlider;
1 change: 1 addition & 0 deletions apps/common-app/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export { default as Switch } from './Switch';
export { default as Select } from './Select';
export { default as Container } from './Container';
export { default as BGGradient } from './BGGradient';
export { default as VerticalSlider } from './VerticalSlider';
5 changes: 4 additions & 1 deletion apps/common-app/src/examples/AudioFile/AudioPlayer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { AudioContext, PlaybackNotificationManager } from 'react-native-audio-api';
import {
AudioContext,
PlaybackNotificationManager,
} from 'react-native-audio-api';
import type {
AudioBufferSourceNode,
AudioBuffer,
Expand Down
103 changes: 103 additions & 0 deletions apps/common-app/src/examples/Distorted/Distorted.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import React, { useCallback, useEffect, useState, FC } from 'react';
import { ActivityIndicator } from 'react-native';
import {
AudioContext,
AudioNode,
AudioBuffer,
AudioBufferSourceNode,
} from 'react-native-audio-api';
import { Container, Button } from '../../components';
import { presetEffects } from '../../utils/effects';

const URL = 'https://files.catbox.moe/s2i1wn.flac';

const Distorted: FC = () => {
const [isPlaying, setIsPlaying] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [buffer, setBuffer] = useState<AudioBuffer | null>(null);

const aCtxRef = React.useRef<AudioContext | null>(null);
const effectsMap = React.useRef<Map<string, AudioNode> | null>(null);
const sourceNodeRef = React.useRef<AudioBufferSourceNode | null>(null);

const fetchAudioBuffer = useCallback(async () => {
setIsLoading(true);

if (!aCtxRef.current) {
aCtxRef.current = new AudioContext();
}
const audioContext = aCtxRef.current;

effectsMap.current = presetEffects.distorted(audioContext);

const audioBuffer = await fetch(URL, {
headers: {
'User-Agent':
'Mozilla/5.0 (Android; Mobile; rv:122.0) Gecko/122.0 Firefox/122.0',
},
})
.then((response) => response.arrayBuffer())
.then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer))
.catch((error) => {
console.error('Error decoding audio data source:', error);
return null;
});

setBuffer(audioBuffer);

setIsLoading(false);
}, []);

const togglePlayPause = useCallback(async () => {
if (!aCtxRef.current) {
return;
}

if (buffer === null) {
fetchAudioBuffer();
return;
}

if (isPlaying) {
sourceNodeRef.current?.stop();
} else {
await aCtxRef.current.resume();
sourceNodeRef.current = aCtxRef.current.createBufferSource();
sourceNodeRef.current.buffer = buffer;

let previousNode: AudioNode = sourceNodeRef.current;
effectsMap.current?.forEach((node) => {
previousNode.connect(node);
previousNode = node;
});

previousNode.connect(aCtxRef.current.destination);

sourceNodeRef.current.start();
}

setIsPlaying((prev) => !prev);
}, [isPlaying, buffer, fetchAudioBuffer]);

useEffect(() => {
fetchAudioBuffer();

return () => {
aCtxRef.current?.close();
aCtxRef.current = null;
};
}, [fetchAudioBuffer]);

return (
<Container centered>
{isLoading && <ActivityIndicator color="#FFFFFF" />}
<Button
title={isPlaying ? 'Stop' : 'Play'}
onPress={togglePlayPause}
disabled={isLoading}
/>
</Container>
);
};

export default Distorted;
1 change: 1 addition & 0 deletions apps/common-app/src/examples/Distorted/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Distorted';
Loading