I get the following error when I try to run the command: artillery run realtime_transcribing_test.yaml
:
TypeError: Cannot read property 'capture' of null.
realtime_transcribing_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
binary-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();
}
Both the files are placed within the same directory. With my current findings this is a very generic error statement thrown by artillery. I have also verified the validity of the YAML file. Please help me understand the issue with my configuration.