agora-extension-ai-denoiser
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "agora-extension-ai-denoiser", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -8,8 +8,8 @@ "keywords": [], | ||
"module": "index.esm.js", | ||
"typings": "agora-extension-ai-denoiser.d.ts", | ||
"typings": "index.d.ts", | ||
"author": "agora", | ||
"peerDependencies": { | ||
"agora-rtc-sdk-ng": ">=4.10.0" | ||
"agora-rtc-sdk-ng": ">=4.15.0" | ||
}, | ||
"license": "MIT" | ||
} |
### Install AI denoiser extension with Agora web SDK. | ||
```javascript | ||
import {AIDenoiserExtension} from "agora-extension-ai-denoiser"; | ||
// Create AIDenoiserExtension instance, please make sure this instance is a singleton, assetsPath is the path of wasm and wasmjs. | ||
const denoiser = new AIDenoiserExtension({assetsPath:'./external'}); | ||
// Create AIDenoiserExtension instance, assetsPath is the path of wasm files. | ||
const extension = new AIDenoiserExtension({assetsPath:'./external'}); | ||
// Register AI denoiser extension into AgoraRTC. | ||
AgoraRTC.registerExtensions([denoiser]); | ||
AgoraRTC.registerExtensions([extension]); | ||
// listen the loaderror callback to handle loading module failed. | ||
denoiser.onloaderror = (e) => { | ||
extension.onloaderror = (e) => { | ||
// if loading denoiser is failed, disable the function of denoiser. For example, set your button disbled. | ||
@@ -21,13 +22,15 @@ openDenoiserButton.enabled = false; | ||
```javascript | ||
const processor = denoiser.createProcessor(); | ||
const processor = extension.createProcessor(); | ||
// If you want to enable the processor by default. | ||
processor.enable(); | ||
await processor.enable(); | ||
// If you want to disable the processor by default. | ||
// processor.disable(); | ||
// await processor.disable(); | ||
// Optional, listen the processor`s overlaod callback to catch overload message | ||
processor.onoverload = async () => { | ||
console.log("overload!!!"); | ||
processor.onoverload = async (elapsedTimeInMs) => { | ||
console.log("overload!!!", elapsedTimeInMs); | ||
// fallback or disable | ||
// await processor.setMode("STATIONARY_NS"); | ||
await processor.disable(); | ||
@@ -59,3 +62,12 @@ } | ||
### Change the denoiser mode and level. | ||
```javascript | ||
await processor.setMode("NSNG"); // recommended | ||
await processor.setMode("STATIONARY_NS"); | ||
await processor.setLevel("LEVEL26"); // recommended | ||
await processor.setLevel("LEVEL40"); | ||
``` | ||
### Dump audio (download files which are 30s audio file before the method called and two audio files 30s after the method called) | ||
@@ -66,5 +78,8 @@ ```javascript | ||
const tag = document.createElement("a"); | ||
tag.download = name + ".wav"; | ||
tag.download = name; | ||
tag.href = objectURL; | ||
tag.click(); | ||
setTimeout(() => { | ||
URL.revokeObjectURL(objectURL); | ||
}, 0); | ||
} | ||
@@ -77,2 +92,2 @@ | ||
processor.dump(); | ||
``` | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4869162
90
4
7
994