[MUSIC PLAYING]
LUKE HOPKINS: Good afternoon.
So first, I'd like to start by getting a show of hands.
So who here uses Bluetooth headphones to make a call?
Pretty much everyone.
Who here notices that when you're listening to music,
or basically watching your favorite movies,
and then you accept a call or you join a conference
call, and your audio quality kind of drops,
and there's a big difference?
Good, OK, we do see some people here.
So today we're going to talk about how we can use low energy
audio and how this can improve the quality of your calling
applications.
So my name is Luke.
I'm a Developer Relations Engineer here at Google.
So in Android 13 comes support for Bluetooth for low energy
audio hearable devices.
This means a lot of the APIs we're looking at today
are available for you to start using from today.
LE audio brings huge advancements to Bluetooth,
providing users with great battery performance
and high quality streaming.
I think as an engineering team here,
we know you don't normally get both of those things together.
So you don't normally get battery life and performance.
So what we're finding is that you can stream up
to 32 kilohertz for media and phone calls,
both for input and output.
So no longer will the quality of your calls
drop when you're using BLE audio headphones.
LE audio does support multi-stream audio.
This means it's capable of streaming
multiple, independent, and synchronized audio streams.
So a quick scenario I want to picture here
is this, nothing here that's actually going on and real.
But what you might want to do is demonstrate
some of the possibilities that we could
have with this technology.
So all of us here, I want us to imagine we're at an airport
right now.
And we're sitting down.
We're in our nice little bubble.
We're listening to our music or watching our favorite movies.
We're at the gate.
And we're generally waiting to board.
What we could do is we could connect
to a broadcast at your gate.
And you could continually listen to your music.
And then from there, you could have the audio broadcasted
to your hearable device.
This kind of means you don't have
to take your headphones off, kind of listen
for your gate number to be called,
whether you're being called.
So there's some really unique and interesting use cases
that could come from this technology.
So we're really looking forward to talking about this
a lot more in the future.
So the LE Audio stack is in Android 13.
And it officially supports the Bluetooth 5.3.
And it comes with the default LC3 Audio Codec.
This essentially means that the LC 3 Audio
Codec replaces media and the codecs for hands-free profile
calls.
So this codec is much more efficient.
It's reconfigurable.
And it produces a higher quality of audio for your applications.
For a lot of you that don't want to look at codecs
and get involved with that, this stuff's
kind of all done for you under the hood.
It's on by default. So you don't have
to worry about a lot of these codec requirements,
as it's on default--
it's on by default for media and calls.
So LE Audio also does come with huge improvements
and new standards for hearing aids, too.
So it offers better experiences for users
with hearing impairments.
And as someone that's hard of hearing myself
and has to wear hearing aids on a day-to-day basis,
it's really good to see these new accessibility needs
coming with this technology.
So the Hearing Aid Profile offers support for microphone
during calls.
And it does have separate channels
for left and right audio.
So this hands-free profile is kind of the new standard, which
really aims to improve the quality and the features
for hearing aid devices.
And I know, for people that normally have accessibility
issues and kind of need new technology,
it's really good to see these consumer level features
coming to people with accessibility needs.
That's really good to see how this is going to drive forward,
going forward in the future.
LE Audio does come with two paths
to consider when using microphones-- so one
being Recording Mode.
And the second being Communication Mode.
So Recording Mode offers high quality, large audio buffers,
and multi-channel support for left and right microphones,
whilst Communication Mode offers low latency,
and is the best experience you really
want for your Dialer or your VoIP calling applications.
So now that you know a lot more about LE Audio,
I'm sure you want to know how to implement it
in your applications.
So there's essentially two ways you
can implement it into your calling applications today.
And that's the Audio Manager and the Telecom API.
So the Audio Manager offers a way for you
to choose what you want to stream to.
However, it does come with a lot of overheads,
as you have to deal with Bluetooth timeouts,
late management, disconnection, and connection events.
So there's a lot of state management
you need to do in your applications
when looking at the Audio Manager.
Now, the Telecom Manager, on the other hand,
does offer you a much more complete API for your VoIP
application needs.
It's an easy-to-use API which allows
you to switch the audio routing for hearables.
And it does come with a more complete feature
set for VoIP applications, such as being
able to hold the current call.
Or it does inform the platform that there's currently
an active going call.
So let's say you're in a conference call right now.
And then you get an incoming call
in your Dialer application.
By using this API, you're informing the platform
that you're currently in a conference call with your VoIP
application.
So today, we're going to look at the Telecom API,
just due to its rich feature set,
and the needs it has there for LE Audio.
So when writing a VoIP application or a Dialer
application, you always have this notion of,
you're joining a call, or accepting a call.
Maybe you're joining a conference call.
And you always have this notion that there's something
happening in the background.
So you want a foreground or a background service
to deal with the connection of the call.
Just in case someone needs to be browsing on their browser
and they need to open up a different application
once they're on a call, you always
want this notion of having a foreground or background
service when you're writing these applications.
The Telecom Manager here does come
with this, where it's a foreground service.
And it will have methods for incoming and outgoing calls.
So the Telecom service is a foreground service
which is bound to your connection service,
and has methods for these incoming and outgoing calls.
And once it's activated, so once this is instantiated,
inside here, you'll have audio-related methods.
So this one, we can see here, is you
can get a list of all the Bluetooth devices.
And from here, you can choose which Bluetooth
device you wish to connect to.
Next, we have a method where you might
have certain scenarios where you might lose connection.
The user might unplug their headset.
They might lose Bluetooth connection
to their hearable devices.
So we have this on-state change here,
which basically informs you of whenever the audio device has
changed, and really informs you of what
the current audio device is that's being
used by the platform.
Next, users may wish to change between Bluetooth devices,
wired headphones, or the speaker.
So we have a simple method called setAudioRoute
in the connection class.
And this will correctly set up the device's routing state,
if you wish to change between speaker, headsets,
or Bluetooth.
So this is the method you really want
to be using for setting between different devices.
And next, we have another simple method here,
which is called requestBluetoothAudio.
So if you're using API 28 or higher,
when you request for Bluetooth audio to a specific device,
you won't have to set the audio routing paths either,
as this is kind of done for you under the hood.
So with these few lines of code, you
can quickly change between Bluetooth devices
and audio states using the Telecom API, which
means that you can focus more on your application,
rather than dealing with audio states, connected devices,
timeout, and all these events we were talking about earlier.
LE Audio does have the requirement
for both the surface and the hearable device to both support
LE Audio.
So another benefit for the Telecom API
is you don't have to worry about this, as it's kind of done
for you all under the hood.
But if you do need to check if the hardware supports LE Audio,
you can use the API, isLeAudioSupported,
in the Bluetooth adapter.
For a more detailed guide on how to implement the Telecom API,
do audio recording, or general information on LE Audio,
you can find more information on our developer website.
We expect to see a lot more LE Audio devices on the market
next year.
And we look forward to your applications
supporting these new hearables.
I'd like to thank everyone for your time today.
And thank you.
[APPLAUSE]
[MUSIC PLAYING]