Skip to content

Commit

Permalink
Merge pull request #361 from ant-media/improveVolumeMeterProcessorImport
Browse files Browse the repository at this point in the history
Change import of volume meter processor
  • Loading branch information
mekya committed May 15, 2023
2 parents 47db65e + dee2ec7 commit f55a0b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/webapp/js/soundmeter.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

export class SoundMeter {

constructor(context) {
this.context = context;
this.instant = 0.0;
}

async connectToSource(stream, levelCallback, errorCallback) {
await this.context.audioWorklet.addModule(new URL('./volume-meter-processor.js', import.meta.url))
await this.context.audioWorklet.addModule('./volume-meter-processor.js')
.catch((err) => {
if (errorCallback !== undefined) {
errorCallback(err);
Expand All @@ -30,9 +30,9 @@ export class SoundMeter {
console.error(e);
}
}

stop() {
this.mic.disconnect();
}

}

0 comments on commit f55a0b7

Please sign in to comment.