Goal and prerequisites
Read the companion lesson and use the pinned PocketCook checkout. Work in your own learning branch. This exercise combines source reading with observable behavior; do not edit production credentials or upload conversations.
Source to inspect
audio/PcmChunker.kt and PcmChunkerTest.kt. Kotlin files live under app/src/main/java/com/androidengineers/pocketcook/; unit tests under app/src/test/java/com/androidengineers/pocketcook/, device tests under app/src/androidTest/java/com/androidengineers/pocketcook/.
Predict, run, explain
Calculate bytes for 10, 20 and 100 ms at 16 kHz mono PCM16. Feed ten 320-byte fragments into a chunker in a test. Predict the number of outputs after fragment nine and after fragment ten. Run the existing ten-minute simulation, then complete the configurable-chunk exercise in the codelab.
./gradlew :app:testDebugUnitTest --tests '*PcmChunkerTest'
Run commands from gemini-live/. Record the source revision, prediction, result and explanation. A test failing to compile is a setup problem, not the expected behavioral failure. If the device or provider is unavailable, state which checks remain unverified.
Reference reasoning and submission
Expected answers: 320, 640 and 3,200 bytes. After nine fragments there is no complete output; after ten there is one. Eight queued 20 ms chunks represent only 160 ms, so changing chunk size changes burst tolerance even if the channel capacity stays eight. Deliver calculations, a passing sample-order test and a note explaining why the default remains 100 ms.
Self-check
Can another learner reproduce your result from your branch and notes? Can you name the responsible source method without reading the lesson? Have you separated local tests from actual device/provider evidence? Revisit the corresponding concept if any answer is no.
Course study guide · Hands-on codelab · Pinned Android source