Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: webrtc/sdk/android/api/org/webrtc/AudioSource.java

Issue 2710683009: Added support for changing the volume of AudioTrack as discussed in BUG=webrtc:6533 (Closed)
Patch Set: updated based on feedback from reviewers Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/android/api/org/webrtc/AudioSource.java
diff --git a/webrtc/sdk/android/api/org/webrtc/AudioSource.java b/webrtc/sdk/android/api/org/webrtc/AudioSource.java
index 99fcad1cf83281a4c1231fed5a71dd7a13b7c80d..a831d2e73a772ae6324dd82d3f31392ae427a42b 100644
--- a/webrtc/sdk/android/api/org/webrtc/AudioSource.java
+++ b/webrtc/sdk/android/api/org/webrtc/AudioSource.java
@@ -15,7 +15,19 @@ package org.webrtc;
* more {@code AudioTrack} objects.
*/
public class AudioSource extends MediaSource {
+ final long nativeSource;
+
public AudioSource(long nativeSource) {
super(nativeSource);
+ this.nativeSource = nativeSource;
+ }
+
+ /** Sets the volume for the MediaSource. volume is a gain value in the range
+ * 0 to 1
+ */
+ public void setVolume(double volume) {
+ nativeSetVolume(nativeSource, volume);
}
+
+ private static native void nativeSetVolume(long nativeSource, double volume);
}

Powered by Google App Engine
This is Rietveld 408576698