1

当我尝试运行命令时出现以下错误artillery run realtime_transcribing_test.yaml

TypeError:无法读取 null 的属性“捕获”。

realtime_trancribing_test.yaml:

config:
  target: "ws://localhost:8001/calls/live-calls"
  processor: "./binary-payload.js"
  phases:
    - duration: 60
      arrivalRate: 5
scenarios:
    - engine: "ws"
      flow:
        - send:
          rate: 48000
          format: 1
          language: "en-IN"
          user_id: "Test client"
        - think: 1
        - loop:
          - function: "sendBinaryData"
          - send: "{{payload}}"
          - think: 1
          count: 100

二进制payload.js:

module.exports = {
    sendBinaryData
};

function sendBinaryData(userContext, events, done) {
    navigator.mediaDevices
  .getUserMedia({ audio: true, video: false })
  .then(stream => {
    const mediaRecorder = new MediaRecorder(stream, {
      mimeType: 'audio/webm',
    });

    mediaRecorder.addEventListener('dataavailable', event => {
      if (event.data.size > 0) {
        userContext.vars.payload = event.data;
      }
    });

    mediaRecorder.start(100);
    setTimeout(event => {
        mediaRecorder.stop();
      }, 100);
  });
  return done();
}

这两个文件都放在同一个目录中。根据我目前的发现,这是炮兵抛出的一个非常通用的错误声明。我还验证了 YAML 文件的有效性。请帮助我了解我的配置问题。

4

0 回答 0