@@ -26,11 +26,17 @@ public class ExternalAudioProcessingFactory implements AudioProcessingFactory {
26
26
27
27
public static interface AudioProcessing {
28
28
@ CalledByNative ("AudioProcessing" )
29
- void Initialize (int sampleRateHz , int numChannels );
29
+ void initialize (int sampleRateHz , int numChannels );
30
+ /** Called when the processor should be reset with a new sample rate. */
30
31
@ CalledByNative ("AudioProcessing" )
31
32
void Reset (int newRate );
33
+ /**
34
+ * Processes the given capture or render signal. NOTE: `buffer.data` will be
35
+ * freed once this function returns so callers who want to use the data
36
+ * asynchronously must make sure to copy it first.
37
+ */
32
38
@ CalledByNative ("AudioProcessing" )
33
- void Process (int numBans , int numFrames , ByteBuffer buffer );
39
+ void process (int numBans , int numFrames , ByteBuffer buffer );
34
40
}
35
41
36
42
private long apmPtr ;
@@ -51,7 +57,7 @@ public long createNative() {
51
57
return apmPtr ;
52
58
}
53
59
54
- public void SetCapturePostProcessing (@ Nullable AudioProcessing processing ) {
60
+ public void setCapturePostProcessing (@ Nullable AudioProcessing processing ) {
55
61
checkExternalAudioProcessorExists ();
56
62
long newPtr = nativeSetCapturePostProcessing (processing );
57
63
if (capturePostProcessingPtr != 0 ) {
@@ -61,7 +67,7 @@ public void SetCapturePostProcessing(@Nullable AudioProcessing processing) {
61
67
capturePostProcessingPtr = newPtr ;
62
68
}
63
69
64
- public void SetRenderPreProcessing (@ Nullable AudioProcessing processing ) {
70
+ public void setRenderPreProcessing (@ Nullable AudioProcessing processing ) {
65
71
checkExternalAudioProcessorExists ();
66
72
long newPtr = nativeSetRenderPreProcessing (processing );
67
73
if (renderPreProcessingPtr != 0 ) {
@@ -71,17 +77,17 @@ public void SetRenderPreProcessing(@Nullable AudioProcessing processing) {
71
77
renderPreProcessingPtr = newPtr ;
72
78
}
73
79
74
- public void SetBypassFlagForCapturePost ( boolean bypass ) {
80
+ public void setBypassFlagForCapturePost ( boolean bypass ) {
75
81
checkExternalAudioProcessorExists ();
76
82
nativeSetBypassFlagForCapturePost (bypass );
77
83
}
78
84
79
- public void SetBypassFlagForRenderPre ( boolean bypass ) {
85
+ public void setBypassFlagForRenderPre ( boolean bypass ) {
80
86
checkExternalAudioProcessorExists ();
81
87
nativeSetBypassFlagForRenderPre (bypass );
82
88
}
83
89
84
- public void Destroy () {
90
+ public void destroy () {
85
91
checkExternalAudioProcessorExists ();
86
92
if (renderPreProcessingPtr != 0 ) {
87
93
JniCommon .nativeReleaseRef (renderPreProcessingPtr );
0 commit comments