MCPcopy Index your code
hub / github.com/codeaashu/claude-code / requestMicrophonePermission

Function requestMicrophonePermission

src/services/voice.ts:241–257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239// result over the TCC status API, which can be unreliable for ad-hoc
240// signed or cross-architecture binaries (e.g., x64-on-arm64).
241export async function requestMicrophonePermission(): Promise<boolean> {
242 const napi = await loadAudioNapi()
243 if (!napi.isNativeAudioAvailable()) {
244 return true // non-native platforms skip this check
245 }
246
247 const started = await startRecording(
248 _chunk => {}, // discard audio data — this is a permission probe only
249 () => {}, // ignore silence-detection end signal
250 { silenceDetection: false },
251 )
252 if (started) {
253 stopRecording()
254 return true
255 }
256 return false
257}
258
259export async function checkRecordingAvailability(): Promise<RecordingAvailability> {
260 // Remote environments have no local microphone

Callers 2

callFunction · 0.85
callFunction · 0.85

Calls 3

loadAudioNapiFunction · 0.85
startRecordingFunction · 0.85
stopRecordingFunction · 0.85

Tested by

no test coverage detected