Audio Compression¶
Description¶
The Audio Compression application uses the SPARK Wireless Core to transmit either an uncompressed 48 kHz/16 bits or compressed unidirectional audio stream. The Coordinator will switch between these two audio streams automatically, based on the link quality. When the link quality is good, the stream will be uncompressed 48 kHz/16 bits. When the link quality degrades, it will automatically switch (fallback) to a compressed audio stream. The audio stream will revert to uncompressed once the link quality returns to normal.
Behavior¶
The audio compression processing stage is based on the ADPCM compression algorithm. This compression algorithm compresses audio samples by a factor of 4. This processing stage can be used to reduce the application throughput in order to extend the range while maintaining a relatively good audio quality.
The wireless transmissions use only one timeslot where the Coordinator is transmitting and the Node is receiving. The wireless core alternates between 4 different frequency bands at each transmission.
The following diagram illustrates the general structure of the schedule used in this application.

Figure 19: Audio Compression application’s schedule.¶
Once the application is started, the Coordinator records the audio signal from an audio source on its Line-In jack (blue) and sends it over-the-air to the Node device to be played back on a speaker or headphones connected to their Headphones jack (black).
When the system is in Fallback mode, it will monitor the signal quality continuously. Once the signal quality is good for 3 seconds, it will switch back to normal. The level at which it switches into and out of Fallback mode are different and this hysteresis ensures that the system doesn’t oscillate back and forth in a marginal signal quality environment.
Upon power up, the coordinator will be in Fallback mode. As mentioned above, it will switch to Normal mode after 3 seconds of good link quality.
Coordinator Device¶
LED0 toggles every time a packet is successfully transmitted to the Node (almost always on because of the high packet rate).
LED1 toggles every time a packet is successfully received from the Coordinator (almost always on because of the high packet rate).
LED2 is off in Normal mode and on in Fallback mode.
Interface |
Name |
Description |
---|---|---|
SW1 |
Fallback ON |
Manually enable Fallback mode |
SW2 |
Fallback OFF |
Manually disable Fallback mode |
LED0 |
Transmission Success |
Toggle LED when a wireless transmission is successful. |
LED1 |
Reception Success |
Toggle LED when a wireless reception is successful. |
LED2 |
Fallback Status |
Indicates the fallback status |
Node Device¶
SW1 and SW2 are used to turn the volume up and down respectively. By default, the volume is at the maximum level.
LED0 toggles every time a packet is successfully transmitted to the Node (almost always on because of the high packet rate).
LED1 toggles every time a packet is successfully received from the Coordinator (almost always on because of the high packet rate).
LED2 is off in Normal mode and on in Fallback mode.
Interface |
Name |
Description |
---|---|---|
SW1 |
Volume Up |
Raises the volume (default at 100%). |
SW2 |
Volume Down |
Lowers the volume. |
LED0 |
Transmission Success |
Toggle LED when a wireless transmission is successful. |
LED1 |
Reception Success |
Toggle LED when a wireless reception is successful. |
LED2 |
Fallback Status |
Indicates the fallback status |
Configuration¶
This application does not require specific configurations.