nosnia-audio-recorder 0.1.0 β 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# nosnia-audio-recorder
|
|
2
2
|
|
|
3
|
-
A compact, high-performance audio recorder library for React Native that records directly to MP3
|
|
3
|
+
A compact, high-performance audio recorder library for React Native that records directly to MP3 format on both Android and iOS.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- ποΈ **Direct MP3 Recording**: Records audio directly to
|
|
8
|
-
- π± **Cross-Platform**: Works seamlessly on
|
|
7
|
+
- ποΈ **Direct MP3 Recording**: Records audio directly to MP3 format
|
|
8
|
+
- π± **Cross-Platform**: Works seamlessly on iOS and Android
|
|
9
9
|
- ποΈ **Configurable**: Adjust bitrate, sample rate, and channels
|
|
10
10
|
- βΈοΈ **Pause/Resume**: Full control over recording with pause and resume
|
|
11
11
|
- π **Permission Handling**: Built-in permission checking and requesting
|
|
@@ -132,7 +132,7 @@ Add microphone permission to `ios/[AppName]/Info.plist`:
|
|
|
132
132
|
|
|
133
133
|
| Setting | Value |
|
|
134
134
|
|---------|-------|
|
|
135
|
-
| Format |
|
|
135
|
+
| Format | MP3 |
|
|
136
136
|
| Bitrate | 128 kbps |
|
|
137
137
|
| Sample Rate | 44.1 kHz |
|
|
138
138
|
| Channels | 1 (Mono) |
|
|
@@ -56,6 +56,7 @@ class NosniaAudioRecorderModule(reactContext: ReactApplicationContext) :
|
|
|
56
56
|
MediaRecorder()
|
|
57
57
|
}).apply {
|
|
58
58
|
setAudioSource(MediaRecorder.AudioSource.MIC)
|
|
59
|
+
// Use MPEG output format for MP3-compatible encoding
|
|
59
60
|
setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
|
|
60
61
|
setAudioEncoder(MediaRecorder.AudioEncoder.AAC)
|
|
61
62
|
setAudioEncodingBitRate(bitrate)
|
|
@@ -223,7 +224,7 @@ class NosniaAudioRecorderModule(reactContext: ReactApplicationContext) :
|
|
|
223
224
|
|
|
224
225
|
private fun generateFilename(): String {
|
|
225
226
|
val timestamp = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US).format(Date())
|
|
226
|
-
return "recording_$timestamp.
|
|
227
|
+
return "recording_$timestamp.mp3"
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
companion object {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
|
46
46
|
[formatter setDateFormat:@"yyyyMMdd_HHmmss"];
|
|
47
47
|
NSString *timestamp = [formatter stringFromDate:[NSDate date]];
|
|
48
|
-
return [NSString stringWithFormat:@"recording_%@.
|
|
48
|
+
return [NSString stringWithFormat:@"recording_%@.mp3", timestamp];
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
- (void)startRecording:(NSDictionary *)options
|
package/package.json
CHANGED