mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-04-05 06:26:50 +00:00
fixing some issues with the IDE
This commit is contained in:
parent
13d7686258
commit
dd7d262bd3
3 changed files with 20 additions and 20 deletions
|
|
@ -2,14 +2,14 @@ class OwrxAudioProcessor extends AudioWorkletProcessor {
|
|||
constructor(options){
|
||||
super(options);
|
||||
// initialize ringbuffer, make sure it aligns with the expected buffer size of 128
|
||||
this.bufferSize = Math.round(options.processorOptions.maxBufferSize / 128) * 128
|
||||
this.bufferSize = Math.round(options.processorOptions.maxBufferSize / 128) * 128;
|
||||
this.audioBuffer = new Float32Array(this.bufferSize);
|
||||
this.inPos = 0;
|
||||
this.outPos = 0;
|
||||
this.port.addEventListener('message', (m) => {
|
||||
if (typeof(m.data) === 'string') {
|
||||
const json = JSON.parse(m.data);
|
||||
if (json.cmd && json.cmd == 'getBuffers') {
|
||||
if (json.cmd && json.cmd === 'getBuffers') {
|
||||
this.reportBuffers();
|
||||
}
|
||||
} else {
|
||||
|
|
@ -31,7 +31,7 @@ class OwrxAudioProcessor extends AudioWorkletProcessor {
|
|||
this.port.addEventListener('messageerror', console.error);
|
||||
this.port.start();
|
||||
}
|
||||
process(inputs, outputs, parameters) {
|
||||
process(inputs, outputs) {
|
||||
const samples = Math.min(128, this.remaining());
|
||||
outputs[0].forEach((output) => {
|
||||
output.set(this.audioBuffer.subarray(this.outPos, this.outPos + samples));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue