Skip to content

Commit 6383a11

Browse files
committed
AudioProcessing implementation
1 parent b65cd2f commit 6383a11

16 files changed

+924
-1
lines changed

webrtc-jni/src/main/cpp/include/JNI_AudioProcessing.h

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2021 Alex Andres
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_H_
18+
#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_H_
19+
20+
#include "JavaClass.h"
21+
#include "JavaRef.h"
22+
23+
#include "modules/audio_processing/include/audio_processing.h"
24+
25+
#include <jni.h>
26+
27+
namespace jni
28+
{
29+
namespace AudioProcessing
30+
{
31+
class JavaAudioProcessingClass : public JavaClass
32+
{
33+
public:
34+
explicit JavaAudioProcessingClass(JNIEnv * env);
35+
36+
jclass cls;
37+
jfieldID stats;
38+
};
39+
40+
void updateStats(const webrtc::AudioProcessingStats & stats, JNIEnv * env, const JavaRef<jobject> & javaType);
41+
}
42+
}
43+
44+
#endif
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2021 Alex Andres
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_CONFIG_H_
18+
#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_CONFIG_H_
19+
20+
#include "JavaClass.h"
21+
#include "JavaRef.h"
22+
23+
#include "modules/audio_processing/include/audio_processing.h"
24+
25+
#include <jni.h>
26+
27+
namespace jni
28+
{
29+
namespace AudioProcessingConfig
30+
{
31+
class JavaAudioProcessingConfigClass : public JavaClass
32+
{
33+
public:
34+
explicit JavaAudioProcessingConfigClass(JNIEnv * env);
35+
36+
jclass cls;
37+
jfieldID echoCancellerEnabled;
38+
jfieldID residualEchoDetectorEnabled;
39+
jfieldID gainControlEnabled;
40+
jfieldID highPassFilterEnabled;
41+
jfieldID noiseSuppressionEnabled;
42+
jfieldID transientSuppressionEnabled;
43+
jfieldID levelEstimationEnabled;
44+
jfieldID voiceDetectionEnabled;
45+
};
46+
47+
webrtc::AudioProcessing::Config toNative(JNIEnv * env, const JavaRef<jobject> & javaType);
48+
}
49+
}
50+
51+
#endif
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2021 Alex Andres
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STATS_H_
18+
#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STATS_H_
19+
20+
#include "JavaClass.h"
21+
#include "JavaRef.h"
22+
23+
#include "modules/audio_processing/include/audio_processing.h"
24+
25+
#include <jni.h>
26+
27+
namespace jni
28+
{
29+
namespace AudioProcessingStats
30+
{
31+
class JavaAudioProcessingStatsClass : public JavaClass
32+
{
33+
public:
34+
explicit JavaAudioProcessingStatsClass(JNIEnv * env);
35+
36+
jclass cls;
37+
jfieldID outputRmsDbfs;
38+
jfieldID voiceDetected;
39+
jfieldID echoReturnLoss;
40+
jfieldID echoReturnLossEnhancement;
41+
jfieldID divergentFilterFraction;
42+
jfieldID delayMs;
43+
jfieldID delayMedianMs;
44+
jfieldID delayStandardDeviationMs;
45+
jfieldID residualEchoLikelihood;
46+
jfieldID residualEchoLikelihoodRecentMax;
47+
};
48+
}
49+
}
50+
51+
#endif
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2021 Alex Andres
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STREAM_CONFIG_H_
18+
#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STREAM_CONFIG_H_
19+
20+
#include "JavaClass.h"
21+
#include "JavaRef.h"
22+
23+
#include "modules/audio_processing/include/audio_processing.h"
24+
25+
#include <jni.h>
26+
27+
namespace jni
28+
{
29+
namespace AudioProcessingStreamConfig
30+
{
31+
class JavaAudioProcessingStreamConfigClass : public JavaClass
32+
{
33+
public:
34+
explicit JavaAudioProcessingStreamConfigClass(JNIEnv * env);
35+
36+
jclass cls;
37+
jmethodID ctor;
38+
jfieldID sampleRate;
39+
jfieldID channels;
40+
};
41+
42+
webrtc::StreamConfig toNative(JNIEnv * env, const JavaRef<jobject> & javaType);
43+
}
44+
}
45+
46+
#endif

0 commit comments

Comments
 (0)