Episode 85: Focus on Audio

Android Developers Backstage

Episode | Podcast

Date: Thu, 21 Dec 2017 01:40:10 +0000

<div dir="ltr" style="text-align: left;"> <div style="text-align: right;"></div> <div style="text-align: right;"></div> <table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"> <tbody> <tr> <td style="text-align: center;"><a href="https://2.bp.blogspot.com/-SZLodEOmqAw/WjsQV5ssvQI/AAAAAAAAE7I/DobVTNBgMhAm6aSUqev0S8sUiX1AjqNggCLcBGAs/s1600/MVIMG_20171129_110337.jpg" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"> <img border="0" height="240" src="https://2.bp.blogspot.com/-SZLodEOmqAw/WjsQV5ssvQI/AAAAAAAAE7I/DobVTNBgMhAm6aSUqev0S8sUiX1AjqNggCLcBGAs/s320/MVIMG_20171129_110337.jpg" width="320" /></a></td> </tr> <tr> <td class="tr-caption" style="text-align: center;">Romain, Jean-Michel, and Tor.<br /> Chet is in the distant background (~2,500 miles west of the studio.)</td> </tr> </tbody> </table> In this episode, Romain and Tor talk with Jean-Michel Trivi from the Android audio team. Tune in to learn about hardware speaker design, ducking and attenuation, stream types, audio tagging, audio focus, and more!<br /> <br /> Links:<br /> <div> <div> <ul style="text-align: left;"> <li>If your activity is playing any audio, don't forget to declare what stream type the hardware volume keys should control with Activity.setVolumeControlStream(int stream)<br /> <a href="https://developer.android.com/guide/topics/media-apps/volume-and-earphones.html"> https://developer.android.com/guide/topics/media-apps/volume-and-earphones.html</a></li> <li>Since Android L, use AudioAttributes to describe your use case and content for your audio playback:<br /> <a href="https://developer.android.com/reference/android/media/AudioAttributes.html"> https://developer.android.com/reference/android/media/AudioAttributes.html</a></li> <li>Use AudioAttributes.getVolumeControlStream() to derive the stream type for volume control in your Activity<br /> <a href="https://developer.android.com/reference/android/media/AudioAttributes.html#getVolumeControlStream()"> https://developer.android.com/reference/android/media/AudioAttributes.html#getVolumeControlStream()</a></li> <li>A summary of what audio focus is, when and how to request and abandon audio focus, and code snippet for your focus listener:<br /> <a href="https://developer.android.com/guide/topics/media-apps/audio-focus.html"> https://developer.android.com/guide/topics/media-apps/audio-focus.html</a></li> <li>And finally, when Jean-Michel isn't working on Android, he's paddling<br /> <a href="https://youtu.be/tZC2rmUdEVk">https://youtu.be/tZC2rmUdEVk</a></li> </ul> </div> </div> Subscribe to the <a href="http://feeds.feedburner.com/blogspot/AndroidDevelopersBackstage" target="_blank">podcast feed</a> or download the <a href="https://storage.googleapis.com/androiddevelopers/android_developers_backstage/ADB%2085%20Focus%20on%20Audio.mp3" target="_blank">audio file</a> directly.<br /> <br /> <b>Jean-Michel</b>: <a href="http://google.com/+JeanMichelTrivi">google.com/+JeanMichelTrivi</a><br /> <b>Romain</b>: <a href="http://google.com/+RomainGuy">google.com/+RomainGuy</a>, <a href="https://twitter.com/romainguy">@romainguy</a><br /> <b>Tor</b>: <a href="http://google.com/+TorNorbye">google.com/+TorNorbye</a>, <a href="https://twitter.com/tornorbye" target="_blank">@tornorbye</a><br /> <b>Chet</b>: <a href="http://google.com/+ChetHaase">google.com/+ChetHaase</a>, <a href="https://twitter.com/chethaase" target="_blank">@chethaase</a><br /> <br /> <i>Thanks to continued tolerance and support by our audio engineer, Bryan Gordon.</i><br /> <br /></div> <img alt="" height="1" src="http://feeds.feedburner.com/~r/blogspot/AndroidDevelopersBackstage/~4/MDIvYoaBxFg" width="1" />