•
to send collateral information for synchronization mechanism implementation
aci_gatt_add_char(ServiceHandle,
UUID_TYPE_128, CharAudioSyncUUID, 6,
CHAR_PROP_NOTIFY, ATTR_PERMISSION_NONE,
GATT_DONT_NOTIFY_EVENTS, 16, 1,
CharAudioSyncHandle);
You can choose to not create the BlueVoice Service and the module is not able to transmit audio.
This node can still function as a RECEIVER; however, if the connected module exports the BlueVoice profile; you
must set the handle of the BlueVoice service and characteristics exported by the transmitter module through the
B
luevoiceADPCM_BNRG1_SetRxHandle
API and enable notifications on the other node by calling the
Bluevoi
ceADPCM_BNRG1_EnableNotification
function.
If both the TRANSMITTER and RECEIVER procedures are performed, the module acts as transmitter and
receiver and the working mode is set to HALF-DUPLEX, creating a half-duplex link over Bluetooth Low Energy.
1.3.3
Audio signal injection
The BlueVoiceADPCM_BNRG1 library receives audio PCM input samples.
The
BluevoiceADPCM_BNRG1_AudioIn
function accepts parameters from a PCM buffer, containing all the
acquired audio channels (
channel_tot
according to the previous library configuration) and the number of PCM
samples (for each channel) given as input. An amount of data equal to 1, 2, 5 or 10 ms is accepted, otherwise an
BV_ADPCM_BNRG1_PCM_SAMPLES_ERR
is returned.
The library compresses received PCM input samples; when 10 ms of audio is compressed, the
BluevoiceADPC
M_BNRG1_AudioIn
API returns
BV_ADPCM_BNRG1_OUT_BUF_READY
.
1.3.4
Compressed audio streaming
On the transmitter side, the BlueVoiceADPCM_BNRG1 library gathers compressed data in an internal double
buffer. For every 10 ms of audio, the
BluevoiceADPCM_BNRG1_AudioIn
function returns
BV_ADPCM_BNRG1_O
UT_BUF_READY
to signal output data can be send via Bluetooth Low Energy by calling the
BluevoiceADPCM_B
NRG1_SendData
API.
If the audio sampling frequency is set to 8 kHz, two 20-byte packets are sent every 10 ms (according to the
connection interval); if the frequency is 16 kHz, four 20-byte packets are sent.
On the receiver side, compressed audio is received from a notification through a
EVT_BLUE_GATT_NOTIFICATION event and passed to the
BluevoiceADPCM_BNRG1_ParseData
function
that decompresses the data and returns a PCM buffer. This API is used to parse both audio and collateral
information data.
UM2257
BlueVoiceADPCM_BNRG1 library software description
UM2257
-
Rev 2
page 14/35