Skip to content

Commit 884ed06

Browse files
committed
refactor: remove explicit buffer capacity configuration in PowerPlayMultiPlayer audio stream builder
1 parent 0316fa1 commit 884ed06

2 files changed

Lines changed: 4 additions & 24 deletions

File tree

samples/powerplay/src/main/cpp/PowerPlayMultiPlayer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ bool PowerPlayMultiPlayer::openStream(oboe::PerformanceMode performanceMode) {
5858
->setUsage(Usage::Media)
5959
->setContentType(ContentType::Music)
6060
->setFramesPerDataCallback(128)
61-
->setBufferCapacityInFrames(8192)
6261
->setSharingMode(SharingMode::Exclusive);
6362

6463
Result result = builder.openStream(mAudioStream);

samples/powerplay/src/main/kotlin/com/google/oboe/samples/powerplay/MainActivity.kt

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -982,28 +982,11 @@ class MainActivity : ComponentActivity() {
982982
var canUseSpeed = isPlaybackParamsSupported
983983
var canUsePitch = isPlaybackParamsSupported
984984

985-
if (isOffload) {
986-
canUsePitch = false // Pitch is always disabled in offload according to rules
987-
988-
if (isMMap) {
989-
canUseSpeed = when (fileSampleRate) {
990-
44100 -> true // Allowed as per testing
991-
48000, 96000 -> true
992-
else -> false // Default to false for safety
993-
}
994-
} else {
995-
// Classic PCM Offload
996-
canUseSpeed = when (fileSampleRate) {
997-
44100, 48000, 96000 -> true
998-
else -> true // Default to true for Classic
999-
}
1000-
}
1001-
}
985+
// For testing: allow everything except API 37 gate
986+
// The previous offload restrictions have been removed to test allowing everything.
1002987

1003988
Spacer(modifier = Modifier.height(16.dp))
1004-
val speedSupportText = if (!isPlaybackParamsSupported) " (Requires API 37)"
1005-
else if (isOffload && !canUseSpeed) " (Not supported for ${fileSampleRate/1000}kHz in MMAP Offload)"
1006-
else ""
989+
val speedSupportText = if (!isPlaybackParamsSupported) " (Requires API 37)" else ""
1007990
Text(
1008991
text = "Playback Speed: ${"%.2f".format(playbackSpeed)}x$speedSupportText",
1009992
style = MaterialTheme.typography.bodyMedium,
@@ -1025,9 +1008,7 @@ class MainActivity : ComponentActivity() {
10251008
)
10261009

10271010
Spacer(modifier = Modifier.height(8.dp))
1028-
val pitchSupportText = if (!isPlaybackParamsSupported) " (Requires API 37)"
1029-
else if (isOffload) " (Not supported in Offload mode)"
1030-
else ""
1011+
val pitchSupportText = if (!isPlaybackParamsSupported) " (Requires API 37)" else ""
10311012
Text(
10321013
text = "Playback Pitch: ${"%.2f".format(playbackPitch)}x$pitchSupportText",
10331014
style = MaterialTheme.typography.bodyMedium,

0 commit comments

Comments
 (0)