Skip to content

Commit aa082c4

Browse files
author
Maciej Makowski
committed
chore: released 0.7.0
1 parent b7b8078 commit aa082c4

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

apps/common-app/src/examples/Record/Record.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
AudioRecorder,
66
RecorderAdapterNode,
77
AudioBufferSourceNode,
8-
AudioBuffer
8+
AudioBuffer,
99
} from 'react-native-audio-api';
1010

1111
import { Container, Button } from '../../components';
@@ -21,21 +21,21 @@ const Record: FC = () => {
2121
const audioBuffersRef = useRef<AudioBuffer[]>([]);
2222
const sourcesRef = useRef<AudioBufferSourceNode[]>([]);
2323

24-
2524
useEffect(() => {
2625
AudioManager.setAudioSessionOptions({
2726
iosCategory: 'playAndRecord',
2827
iosMode: 'spokenAudio',
2928
iosOptions: ['defaultToSpeaker', 'allowBluetoothA2DP'],
3029
});
31-
30+
31+
AudioManager.requestRecordingPermissions();
32+
3233
recorderRef.current = new AudioRecorder({
3334
sampleRate: SAMPLE_RATE,
3435
bufferLengthInSamples: SAMPLE_RATE,
3536
});
3637
}, []);
3738

38-
3939
const startEcho = () => {
4040
if (!recorderRef.current) {
4141
console.error('AudioContext or AudioRecorder is not initialized');
@@ -46,15 +46,15 @@ const Record: FC = () => {
4646
recorderAdapterRef.current = aCtxRef.current.createRecorderAdapter();
4747
recorderAdapterRef.current.connect(aCtxRef.current.destination);
4848
recorderRef.current.connect(recorderAdapterRef.current);
49-
49+
5050
recorderRef.current.start();
51-
console.log('Recording started');
51+
console.log('Recording started');
5252
console.log('Audio context state:', aCtxRef.current.state);
5353
if (aCtxRef.current.state === 'suspended') {
5454
console.log('Resuming audio context');
5555
aCtxRef.current.resume();
5656
}
57-
}
57+
};
5858

5959
/// This stops only the recording, not the audio context
6060
const stopEcho = () => {
@@ -66,7 +66,7 @@ const Record: FC = () => {
6666
aCtxRef.current = null;
6767
recorderAdapterRef.current = null;
6868
console.log('Recording stopped');
69-
}
69+
};
7070

7171
const startRecordReplay = () => {
7272
if (!recorderRef.current) {
@@ -92,8 +92,7 @@ const Record: FC = () => {
9292
recorderRef.current?.stop();
9393
console.log('Recording stopped');
9494
}, 5000);
95-
96-
}
95+
};
9796

9897
const stopRecordReplay = () => {
9998
const aCtx = new AudioContext({ sampleRate: SAMPLE_RATE });
@@ -128,19 +127,22 @@ const Record: FC = () => {
128127
},
129128
(nextStartAt - tNow) * 1000
130129
);
131-
132-
}
130+
};
133131

134132
return (
135133
<Container style={{ gap: 40 }}>
136-
<Text style={{ color: colors.white, fontSize: 24, textAlign: 'center' }}>Sample rate: {SAMPLE_RATE}</Text>
134+
<Text style={{ color: colors.white, fontSize: 24, textAlign: 'center' }}>
135+
Sample rate: {SAMPLE_RATE}
136+
</Text>
137137
<View style={{ alignItems: 'center', justifyContent: 'center', gap: 5 }}>
138138
<Text style={{ color: colors.white, fontSize: 24 }}>Echo example</Text>
139139
<Button title="Start Recording" onPress={startEcho} />
140140
<Button title="Stop Recording" onPress={stopEcho} />
141141
</View>
142142
<View style={{ alignItems: 'center', justifyContent: 'center', gap: 5 }}>
143-
<Text style={{ color: colors.white, fontSize: 24 }}>Record & replay example</Text>
143+
<Text style={{ color: colors.white, fontSize: 24 }}>
144+
Record & replay example
145+
</Text>
144146
<Button title="Record for Replay" onPress={startRecordReplay} />
145147
<Button title="Replay" onPress={stopRecordReplay} />
146148
</View>

apps/fabric-example/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,7 @@ PODS:
22432243
- React-perflogger (= 0.80.0)
22442244
- React-utils (= 0.80.0)
22452245
- SocketRocket
2246-
- RNAudioAPI (0.7.0):
2246+
- RNAudioAPI (0.7.1):
22472247
- boost
22482248
- DoubleConversion
22492249
- fast_float
@@ -2270,10 +2270,10 @@ PODS:
22702270
- ReactCodegen
22712271
- ReactCommon/turbomodule/bridging
22722272
- ReactCommon/turbomodule/core
2273-
- RNAudioAPI/audioapi (= 0.7.0)
2273+
- RNAudioAPI/audioapi (= 0.7.1)
22742274
- SocketRocket
22752275
- Yoga
2276-
- RNAudioAPI/audioapi (0.7.0):
2276+
- RNAudioAPI/audioapi (0.7.1):
22772277
- boost
22782278
- DoubleConversion
22792279
- fast_float
@@ -2300,10 +2300,10 @@ PODS:
23002300
- ReactCodegen
23012301
- ReactCommon/turbomodule/bridging
23022302
- ReactCommon/turbomodule/core
2303-
- RNAudioAPI/audioapi/ios (= 0.7.0)
2303+
- RNAudioAPI/audioapi/ios (= 0.7.1)
23042304
- SocketRocket
23052305
- Yoga
2306-
- RNAudioAPI/audioapi/ios (0.7.0):
2306+
- RNAudioAPI/audioapi/ios (0.7.1):
23072307
- boost
23082308
- DoubleConversion
23092309
- fast_float
@@ -2955,7 +2955,7 @@ SPEC CHECKSUMS:
29552955
ReactAppDependencyProvider: 3267432b637c9b38e86961b287f784ee1b08dde0
29562956
ReactCodegen: d82f538f70f00484d418803f74b5a0ea09cc8689
29572957
ReactCommon: b028d09a66e60ebd83ca59d8cc9a1216360db147
2958-
RNAudioAPI: 373a0f79aab614f1a6dbe43944a17d35365c5b8b
2958+
RNAudioAPI: 5d67008b0e2d36e255efb1b157c801e6f2dfa938
29592959
RNGestureHandler: eeb622199ef1fb3a076243131095df1c797072f0
29602960
RNReanimated: 402e6a3b84071df4da6264630a1b99962a113d2d
29612961
RNScreens: ee2abe7e0c548eed14e92742e81ed991165c56aa

packages/react-native-audio-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-audio-api",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification",
55
"bin": {
66
"setup-rn-audio-api-web": "./scripts/setup-rn-audio-api-web.js"

0 commit comments

Comments
 (0)