可以将 Windows 10 WSL 连接到笔记本电脑麦克风吗

可以将 Windows 10 WSL 连接到笔记本电脑麦克风吗

我需要将笔记本电脑的麦克风传输到 WSL 环境中。在 Windows 和 WSL 上都成功安装了 pulseAudio - 但我的程序仍然无法连接到麦克风:(WSL 下的节点程序):

var record = require('node-record-lpcm16')
let stream = record.start({
    sampleRate: 16000,
    channels: 1,
    compress: false,
    threshold: 0.0001,
    thresholdStart: null,
    thresholdEnd: null,
    silence: '1.0',
    verbose: false
 })

错误是

events.js:187
     throw er; // Unhandled 'error' event
     ^
Error: spawn rec ENOENT
   at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
   at onErrorNT (internal/child_process.js:456:16)
   at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
   at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
   at onErrorNT (internal/child_process.js:456:16)
   at processTicksAndRejections (internal/process/task_queues.js:80:21) {
 errno: 'ENOENT',
 code: 'ENOENT',
 syscall: 'spawn rec',
 path: 'rec',
 spawnargs: [
   '-q',             '-r',
   16000,            '-c',
   1,                '-e',
   'signed-integer', '-b',
   '16',             '-t',
   'wav',            '-',
   'silence',        '1',
   '0.1',            '0.0001%',
   '1',              '1.0',
   '0.0001%'
 ]
}

相关内容