MCPcopy Create free account
hub / github.com/Noumena-Network/code / loadNativeBinding

Function loadNativeBinding

src/shims/audioCaptureNapi.ts:19–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17let cachedBinding: NativeAudioBinding | null | undefined
18
19function loadNativeBinding(): NativeAudioBinding | null {
20 if (cachedBinding !== undefined) {
21 return cachedBinding
22 }
23
24 const embeddedPath = getEmbeddedAudioCapturePath()
25 if (!embeddedPath) {
26 cachedBinding = null
27 return cachedBinding
28 }
29
30 try {
31 cachedBinding = requireFn(embeddedPath) as NativeAudioBinding
32 } catch {
33 cachedBinding = null
34 }
35
36 return cachedBinding
37}
38
39export function isNativeAudioAvailable(): boolean {
40 return loadNativeBinding() !== null

Callers 9

isNativeAudioAvailableFunction · 0.70
startRecordingFunction · 0.70
stopRecordingFunction · 0.70
isRecordingFunction · 0.70
startPlaybackFunction · 0.70
writePlaybackDataFunction · 0.70
stopPlaybackFunction · 0.70
isPlayingFunction · 0.70

Calls 1

Tested by

no test coverage detected