nosnia-audio-recorder 0.9.10 → 0.9.11
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.
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
BOOL _isRecording;
|
|
18
18
|
NSTimer *_progressTimer;
|
|
19
19
|
BOOL _hasListeners;
|
|
20
|
-
double _elapsedTimeMs;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
RCT_EXPORT_MODULE(NosniaAudioRecorder)
|
|
@@ -56,7 +55,6 @@ RCT_EXPORT_MODULE(NosniaAudioRecorder)
|
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
NSLog(@"[NosniaAudioRecorder] Starting progress timer");
|
|
59
|
-
_elapsedTimeMs = 0.0;
|
|
60
58
|
|
|
61
59
|
// Send initial duration event immediately
|
|
62
60
|
if (_audioRecorder && _isRecording) {
|
|
@@ -73,15 +71,19 @@ RCT_EXPORT_MODULE(NosniaAudioRecorder)
|
|
|
73
71
|
repeats:YES
|
|
74
72
|
block:^(NSTimer * _Nonnull timer) {
|
|
75
73
|
if (self->_audioRecorder && self->_isRecording) {
|
|
76
|
-
//
|
|
77
|
-
self->
|
|
74
|
+
// Update meters to ensure accurate currentTime reading
|
|
75
|
+
[self->_audioRecorder updateMeters];
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
// Use the recorder's currentTime directly - this is the reliable way
|
|
78
|
+
double durationMs = self->_audioRecorder.currentTime * 1000.0;
|
|
79
|
+
|
|
80
|
+
NSLog(@"[NosniaAudioRecorder] Duration: %.0f ms (currentTime: %.4f seconds)",
|
|
81
|
+
durationMs, self->_audioRecorder.currentTime);
|
|
80
82
|
|
|
81
83
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
82
84
|
[self sendEventWithName:@"onRecordingProgress"
|
|
83
85
|
body:@{
|
|
84
|
-
@"duration": @(
|
|
86
|
+
@"duration": @(durationMs),
|
|
85
87
|
@"isRecording": @(self->_audioRecorder.isRecording)
|
|
86
88
|
}];
|
|
87
89
|
});
|
package/package.json
CHANGED