Usage
SDK Initialization
To use the SDK, you must initialize a single instance of DHDenoiser
for noise reduction. You can set the necessary values for initialization using the DHDenoiserConfig.Builder
.
- Java
- Kotlin
String LICENSE_KEY = "YOUR_LICENSE_KEY"
DHDenoiserConfig denoiserConfig = new DHDenoiserConfig.Builder(LICENSE_KEY).build();
DHDenoiser.init(this, denoiserConfig);
val LICENSE_KEY = "YOUR_LICENSE_KEY"
val denoiserConfig = DHDenoiserConfig.Builder(LICENSE_KEY).build()
DHDenoiser.init(this, denoiserConfig)
License Expiration Check
If the license key is invalid or expired, the noise reduction feature will not work via the process
function. After initialization, you can use the isExpired
function to check if the license is valid.
- Java
- Kotlin
if (DHDenoiser.isExpired()) {
Log.e("DHDenoiser", "SDK has expired");
}
if (DHDenoiser.isExpired()) {
Log.e("DHDenoiser", "SDK has expired")
}
Noise Reduction
Once initialization is complete, you can use the process
function to remove noise.
- Java
- Kotlin
int frameSize = 128; // default size
float[] input = new float[frameSize];
float[] output = new float[frameSize];
DHDenoiser.process(input, output);
val frameSize = 128 // default size
val input = FloatArray(frameSize)
val output = FloatArray(frameSize)
DHDenoiser.process(input, output)