native-recorder-nodejs 1.0.7 → 1.0.8
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/CMakeLists.txt +1 -0
- package/README.md +3 -3
- package/native/mac/AVFEngine.mm +5 -5
- package/native/mac/SCKAudioCapture.mm +5 -5
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/NativeAudioSDK.node +0 -0
- package/prebuilds/darwin-x64/NativeAudioSDK.node +0 -0
- package/prebuilds/win32-x64/NativeAudioSDK.node +0 -0
package/CMakeLists.txt
CHANGED
package/README.md
CHANGED
|
@@ -21,8 +21,8 @@ High-performance, low-latency native audio recording SDK for Node.js. Supports b
|
|
|
21
21
|
| ------------- | ------------ | ----------- | ----------------------- |
|
|
22
22
|
| Windows 10/11 | x64 | Supported | Supported (per-device) |
|
|
23
23
|
| Windows 10/11 | ia32 | Supported | Supported (per-device) |
|
|
24
|
-
| macOS
|
|
25
|
-
| macOS
|
|
24
|
+
| macOS 13.0+ | arm64 | Supported | Supported (system-wide) |
|
|
25
|
+
| macOS 13.0+ | x64 | Supported | Supported (system-wide) |
|
|
26
26
|
|
|
27
27
|
### Platform Differences
|
|
28
28
|
|
|
@@ -31,7 +31,7 @@ High-performance, low-latency native audio recording SDK for Node.js. Supports b
|
|
|
31
31
|
| Input Devices | Multiple (WASAPI) | Multiple (AVFoundation) |
|
|
32
32
|
| Output Devices | Multiple (per-device) | Single "System Audio" device |
|
|
33
33
|
| Permissions | None required | Microphone + Screen Recording |
|
|
34
|
-
| Min OS Version | Windows 10+ | macOS
|
|
34
|
+
| Min OS Version | Windows 10+ | macOS 13.0+ (for system audio) |
|
|
35
35
|
|
|
36
36
|
## Installation
|
|
37
37
|
|
package/native/mac/AVFEngine.mm
CHANGED
|
@@ -77,10 +77,10 @@ void AVFEngine::Start(const std::string &deviceType, const std::string &deviceId
|
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
if (@available(macOS
|
|
80
|
+
if (@available(macOS 13.0, *)) {
|
|
81
81
|
[impl->sckCapture startWithCallback:dataCb errorCallback:errorCb];
|
|
82
82
|
} else {
|
|
83
|
-
if (errorCb) errorCb("System audio recording requires macOS
|
|
83
|
+
if (errorCb) errorCb("System audio recording requires macOS 13.0 or later.");
|
|
84
84
|
}
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
@@ -166,7 +166,7 @@ std::vector<AudioDevice> AVFEngine::GetDevices() {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// Add system audio output device (only one on macOS)
|
|
169
|
-
if (@available(macOS
|
|
169
|
+
if (@available(macOS 13.0, *)) {
|
|
170
170
|
AudioDevice systemDevice;
|
|
171
171
|
systemDevice.id = AudioEngine::SYSTEM_AUDIO_DEVICE_ID;
|
|
172
172
|
systemDevice.name = "System Audio";
|
|
@@ -217,7 +217,7 @@ PermissionStatus AVFEngine::CheckPermission() {
|
|
|
217
217
|
// Check screen capture permission (for system audio)
|
|
218
218
|
// ScreenCaptureKit doesn't have a direct permission check API,
|
|
219
219
|
// but we can check if we can get shareable content
|
|
220
|
-
if (@available(macOS
|
|
220
|
+
if (@available(macOS 13.0, *)) {
|
|
221
221
|
__block BOOL hasScreenPermission = NO;
|
|
222
222
|
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
|
223
223
|
|
|
@@ -255,7 +255,7 @@ bool AVFEngine::RequestPermission(PermissionType type) {
|
|
|
255
255
|
}
|
|
256
256
|
else if (type == PermissionType::System) {
|
|
257
257
|
// Request screen capture permission for system audio
|
|
258
|
-
if (@available(macOS
|
|
258
|
+
if (@available(macOS 13.0, *)) {
|
|
259
259
|
// Attempting to get shareable content will trigger the permission prompt
|
|
260
260
|
// if not already granted
|
|
261
261
|
[SCShareableContent getShareableContentWithCompletionHandler:^(SCShareableContent * _Nullable shareableContent, NSError * _Nullable error) {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
self.dataCallback = dataCb;
|
|
30
30
|
self.errorCallback = errorCb;
|
|
31
31
|
|
|
32
|
-
if (@available(macOS
|
|
32
|
+
if (@available(macOS 13.0, *)) {
|
|
33
33
|
[SCShareableContent getShareableContentExcludingDesktopWindows:YES
|
|
34
34
|
onScreenWindowsOnly:NO
|
|
35
35
|
completionHandler:^(SCShareableContent *content, NSError *error) {
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
});
|
|
77
77
|
}];
|
|
78
78
|
} else {
|
|
79
|
-
if (self.errorCallback) self.errorCallback("ScreenCaptureKit
|
|
79
|
+
if (self.errorCallback) self.errorCallback("ScreenCaptureKit audio capture requires macOS 13.0+");
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
- (void)stop {
|
|
84
|
-
if (@available(macOS
|
|
84
|
+
if (@available(macOS 13.0, *)) {
|
|
85
85
|
if (self.stream) {
|
|
86
86
|
[self.stream stopCaptureWithCompletionHandler:nil];
|
|
87
87
|
self.stream = nil;
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
- (void)stream:(SCStream *)stream didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer ofType:(SCStreamOutputType)type {
|
|
93
93
|
if (type != SCStreamOutputTypeAudio || !self.dataCallback) return;
|
|
94
94
|
|
|
95
|
-
if (@available(macOS
|
|
95
|
+
if (@available(macOS 13.0, *)) {
|
|
96
96
|
CMFormatDescriptionRef formatDesc = CMSampleBufferGetFormatDescription(sampleBuffer);
|
|
97
97
|
const AudioStreamBasicDescription *asbd = CMAudioFormatDescriptionGetStreamBasicDescription(formatDesc);
|
|
98
98
|
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
|
|
204
204
|
// SCStreamDelegate method
|
|
205
205
|
- (void)stream:(SCStream *)stream didStopWithError:(NSError *)error {
|
|
206
|
-
if (@available(macOS
|
|
206
|
+
if (@available(macOS 13.0, *)) {
|
|
207
207
|
if (error && self.errorCallback) {
|
|
208
208
|
self.errorCallback("Stream stopped with error: " + std::string(error.localizedDescription.UTF8String));
|
|
209
209
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|