Skip to content

Commit 228c984

Browse files
committed
New API for querying audio properties
Bug: 6635041 Change-Id: I66e87c75af7c84cdb23cb25a958e79bba8e53baa
1 parent d65afc6 commit 228c984

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

media/java/android/media/AudioManager.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,4 +2443,33 @@ public IRingtonePlayer getRingtonePlayer() {
24432443
return null;
24442444
}
24452445
}
2446+
2447+
/**
2448+
* Used as a key for #getProperty to request the native or optimal output sample rate for
2449+
* this device, in decimal Hz.
2450+
* {@hide}
2451+
*/
2452+
public static final String PROPERTY_OUTPUT_SAMPLE_RATE =
2453+
"android.media.property.OUTPUT_SAMPLE_RATE";
2454+
2455+
/**
2456+
* Used as a key for #getProperty to request the native or optimal output buffer size for
2457+
* this device, in decimal PCM frames.
2458+
* {@hide}
2459+
*/
2460+
public static final String PROPERTY_OUTPUT_FRAMES_PER_BUFFER =
2461+
"android.media.property.OUTPUT_FRAMES_PER_BUFFER";
2462+
2463+
/**
2464+
* @param key One of the strings corresponding to a property key: either
2465+
* #PROPERTY_OUTPUT_SAMPLE_RATE or #PROPERTY_OUTPUT_FRAMES_PER_BUFFER
2466+
* @return A string representing the associated value for that property key,
2467+
* or null if there is no value for that key.
2468+
* {@hide}
2469+
*/
2470+
public String getProperty(String key) {
2471+
// uses android.os.SystemProperties.get for selected keys, with suitable defaults
2472+
return null;
2473+
}
2474+
24462475
}

0 commit comments

Comments
 (0)