LED management. A ready-to-use BlueVoice library is included as middleware and a sample application is provided to get you started with voice streaming over BLE to an Android or iOS device, running the ST BlueMS apps.
Audio signal injection ................ 19 1.3.4 Compressed audio streaming ............19 System setup ................. 21 Power supply ................... 21 STEVAL-BLUEMIC-1 evaluation board assembly in form factor case STEVAL-BLUEMIC-1 evaluation board programming interface ..22 STEVAL-BLUEMIC-1 evaluation board demos ....... 23 2.4.1 Streaming to a mobile device ............
Page 3
UM2257 List of tables List of tables Table 1: STEVAL-BLUEMIC-1 evaluation board main component details ..........8 Table 2: BlueMic1 UUID summary table ....................14 Table 3: Document revision history ......................37 DocID030830 Rev 1 3/38...
Page 4
Figure 19: STEVAL-BLUEMIC-1 evaluation board in plastic case ............22 Figure 20: STM32 Nucleo board and STEVAL-BLUEMIC-1 SWD connections with a 5-pin flat cable ... 23 Figure 21: Voice streaming from the STEVAL-BLUEMIC-1 evaluation board to an Android™ or iOS™...
ST BlueMS: Android and iOS demo App available in the respective stores 1.1.2 Evaluation kit The STEVAL-BLUEMIC-1 evaluation kit helps you to start prototyping a very low power solution to stream audio and inertial data over BLE, exploiting the single-mode system-on- chip BlueNRG-1.
Figure 4: Battery a plastic case to house the evaluation board connected to the battery Figure 5: Plastic case an ST-LINK SWD programming cable to program the evaluation board connected to ST-LINK Figure 6: SWD cable 6/38 DocID030830 Rev 1...
Getting started 1.1.3 Evaluation board The STEVAL-BLUEMIC-1 evaluation board is a highly integrated reference design that enables a fast prototyping of very low power solutions for audio and inertial streaming. Figure 7: STEVAL-BLUEMIC-1 evaluation board hardware architecture Figure 8: STEVAL-BLUEMIC-1 evaluation board main components...
Getting started UM2257 Table 1: STEVAL-BLUEMIC-1 evaluation board main component details Reference Device Description Bluetooth Low Energy application processor compliant with BT SPBTLE-1S specification v4.2, based on BlueNRG-1 system-on-chip iNEMO inertial module: low-power 3D accelerometer and 3D LSM6DSL gyroscope MP34DT04-C1...
The STSW-BLUEMIC-1 allows an STEVAL-BLUEMIC-1 evaluation board to act as a peripheral in a point-to-point connection with a mobile device running the ST BlueMS app, available for Android™ and iOS™. In this configuration, the evaluation board streams the audio acquired from the on-board digital MEMS microphone (MP34DT04-C1) or motion data acquired from the 3-axis accelerometer and gyroscope (LSM6DSL).
Getting started UM2257 The application layer manages the complete software chain from the audio and inertial data acquisition to the streaming. A complete set of drivers is available to interact with the on-board sensors and to manage the BlueNRG-1 peripheral. A middleware layer, between the application and the hardware abstraction layer, includes: ...
Page 13
This device only requires a controller that supports the slave role. The central module can be an Android™ and iOS™ device running the ST BlueMS app (v3.0.0 or higher) or a FP-AUD-BVLINK1 receiver node. The central and peripheral role assignment reflects the asymmetric design concept of...
Getting started UM2257 characteristic to expose actual compressed audio data and a Sync characteristic to expose collateral information to implement a synchronization mechanism and an inertial characteristic to expose 3-axis accelerometer and gyroscope raw data. Table 2: BlueMic1 UUID summary table UUID name UUID bluemic1_service_uuid...
UM2257 Getting started 1.2.7 ADPCM compression The ITU-T G.726 adaptive differential pulse code modulation (ADPCM) standard is applied to save bandwidth. This audio algorithm for lossy waveform coding predicts the current signal value from previous values, and transmits the difference between the real and the predicted value, quantized with an adaptive quantization step.
conn_max_int=21.25 ms If the streaming is performed between two ST modules, the selected connection interval is the minimum value (10 ms). The target 64 kbps constant data rate is achieved by sending 80 bytes of ADPCM data (640 bits) at each connection event. Consistent with maxPayload = 20 bytes per packet (160 bit), four packets (two if an audio sampling frequency of 8 kHz is set) of 20 bytes are sent per average connection event.
When the connection is estabilished, the app status is set to APP_STATUS_CONNECTED and two different demos can be activated from the ST BlueMS app running on the central node. If BlueVoice is enabled (firmware status set to APP_BLUEVOICE_ENABLED) audio acquisition from the on-board digital microphone starts and drives the voice streaming.
Getting started UM2257 A timer is set and every 30 ms raw data are acquired from the 3-axis accelerometer and gyroscope and sent to the mobile device together with a timestamp increased by one every 10 ms. BlueVoiceADPCM_BNRG1 library software description 1.3.1 Initialization and configuration To initialize the library call the BluevoiceADPCM_BNRG1_Initialize API.
UM2257 Getting started Alternately, BlueVoice characteristics can be added to a pre-existing service created in your own application by calling BluevoiceADPCM_BNRG1_AddChar and passing the handle of that particular service as a parameter. If both the functions return BV_ADPCM_BNRG1_SUCCESS, the library is set to TRANSMITTER mode and can stream audio over Bluetooth Low Energy.
Page 20
Getting started UM2257 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.
System setup System setup Two types of demos can be set up using an STEVAL-BLUEMIC-1 evaluation board: unidirectional streaming of inertial data and audio at a sampling frequency of 8 kHz from the STEVAL-BLUEMIC-1 to an Android™ or iOS™ device running the ST BlueMS app (v3.0.0 or higher);...
To program the board, connect an external ST-LINK to the SWD connector on the STEVAL-BLUEMIC-1 evaluation board; a 5-pin flat cable is provided in the evaluation kit. The easiest way to obtain an ST-LINK device is to get an STM32 Nucleo board, which bundles an ST-LINK V2.1 debugger and programmer.
2.4.1 Streaming to a mobile device One of the possible demos to be performed using a STEVAL-BLUEMIC-1 evaluation board is the unidirectional streaming from the board to an Android™ or iOS™ device running the ST BlueMS app (v3.0.0 or higher).
System setup UM2257 Figure 21: Voice streaming from the STEVAL-BLUEMIC-1 evaluation board to an Android™ or iOS™ mobile device 2.4.1.1 ST BlueMS app To run this demo: Turn the STEVAL-BLUEMIC-1 evaluation board on via SW1 switch Open the ST BlueMS app on your smartphone or tablet.
2.4.1.2 BlueVoice page When the STEVAL-BLUEMIC-1 evaluation board is connected to a mobile device the on- board green LED turns on and the board starts streaming audio to the mobile device (in this phase the blue LED starts blinking fast).
System setup UM2257 2.4.1.2.1 ASR language selection Opening the ASR language menu, located in the demo main menu, the application displays a popup window that allows the ASR language selection. According to the language selected, a specific ASR service is configured which determines the application behavior.
UM2257 System setup Figure 25: BlueMS (Android version) Chinese ASR, iFlytek technology 2.4.1.2.3 Alternative languages: Google Speech API The ADD button allows the insertion of the key (see Section 2.4.1.2.4: "Google speech ASR Key generation") to enable the ASR feature: a popup window prompts the insertion of a valid API key, followed by the ASR service activation key.
System setup UM2257 Figure 27: BlueMS (Android version) ASR service enabled Hold the recording button to record your voice for subsequent recognition. While the button is pressed, a bar progressively indicates the elapsed recording time. When you release the button a “Sending request…” message appears. 28/38 DocID030830 Rev 1...
UM2257 System setup Figure 28: BlueMS (Android version) voice recording The speech recognized by the ASR service appears below the volume bar. DocID030830 Rev 1 29/38...
System setup UM2257 Figure 29: BlueMS (Android version) recognised voice text If the recording cannot be recognized, a “Token not recognized’ message appears instead of the text. 2.4.1.2.4 Google speech ASR Key generation The Google Speech APIs require a key to access the web-based service. You need a Google account to complete the procedure and access the service.
UM2257 System setup To generate a key: Login with your own Google account. Subscribe to Chromium-dev at https://groups.google.com/a/chromium.org/forum/?fromgroups#!forum/chromium-dev Write “Chromium-dev” in the search box, and select the appropriate group. Figure 30: Google Chromium-dev: search group Click on “Join group to post” button Figure 31: Google Chromium-dev: join group to post Click on “Join this group”...
System setup UM2257 Figure 33: Google Chromium-dev: create project Choose the Project name. Click on “Create” button. Figure 34: Google Developers Console: new project Make sure you have selected the newly created project. Figure 35: Google Developers Console: ASRProject Write "Speech API" in the search box, and select correct result. Figure 36: Google Developers Console: select API Enable the Speech API clicking on the blue button.
Your API key is created. Click on Close to return to the Credentials section. Here you can see your API Key. Figure 39: Google API Manager: Android API key 2.4.1.3 Inertial data plot page The STEVAL-BLUEMIC-1 evaluation board also streams inertial data acquired from the on- board 3-axis accelerometer and gyroscope. DocID030830 Rev 1 33/38...
System setup UM2257 Swipe from the right to open a new page that allows a real-time plot of inertial raw data received from the evaluation board. Gyroscope or accelerometer can be selected from the menu on the top; the plot starts as soon as the "Play button" on the right is pressed. By clicking on the Plot Length menu item, you can set the time scale in seconds to be displayed.
As soon as the central unit is recognized as a standard USB microphone, select the correct option in Microphone Properties (8 or 16 kHz) as shown below. Refer to the relevant page on www.st.com to set up the central module to be used as a receiver. DocID030830 Rev 1...
System setup UM2257 Figure 42: Receiver recognized as USB microphone Use any freeware or commercial audio recording software to interface with the system, for example Audacity ( http://audacity.sourceforge.net/ Open it and press the Record button to record the audio streamed from the STEVAL- BLUEMIC-1 evaluation board.
UM2257 Revision history Revision history Table 3: Document revision history Date Version Changes 17-Jul-2017 Initial release DocID030830 Rev 1 37/38...
Page 38
ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Need help?
Do you have a question about the STEVAL-BLUEMIC-1 and is the answer not in the manual?
Questions and answers