RAKwireless Audio library is designed for RAK audio module and kit solutions. This library provides customer with abundant examples and solutions on audio field. User can use them for any scene
As shown above, audio solutions includes below parts:
At the same time we will release some audio kit
All elements can be used separately or together. However, there are two points need to note:
Please update BSP part to the last version, which will support basic driver.
Then install audio library, which contains other part of driver, like amplifier, DSPG. And includes all examples and solutions. Because of the technical problem, it is not merged in IDE now. Please download ZIP from: https://github.com/RAKWireless/RAKwireless-Audio-library And then install manually.
But if you use Arduino 2.0 released version, you can install it in library manager.
The examples can be separated 4 parts. The test code is just for test and can be ingnored.
Audio graph will show the audio wave with rawdata from microphone, including analog or digital. We have supported several kinds of graph, here we will show the difference by two examples
Here we use RAK4631+RAK18030 to show the digital wave, and same as the analog.
The "Fast Fourier Transform" (FFT) is an important measurement method in the science of audio and acoustics measurement. It converts a signal into individual spectral components and thereby provides frequency information about the signal. FFTs are used for fault analysis, quality control, and condition monitoring of machines or systems. This article explains how an FFT works, the relevant parameters and their effects on the measurement result.
Strictly speaking, the FFT is an optimized algorithm for the implementation of the "Discrete Fourier Transformation" (DFT). A signal is sampled over a period of time and divided into its frequency components. These components are single sinusoidal oscillations at distinct frequencies each with their own amplitude and phase. This transformation is illustrated in the following diagram. Over the time period measured, the signal contains 3 distinct dominant frequencies.
Below is what we get with RAK4631+RAK18032, and of course you can use other wiscore and microphone.
We combine the wireless and audio alarm. When the audio rawdata value reach to a threshold, it will report a alarm by LoRaWAN, WIFI. Or you can just use the local alarm. You can modify the threshold in code.
This example use RAK4631+RAK18003+RAK18030, and based on LoRaWAN OTAA. After join the network, the PDM will listen and report a alarm when triggered.
This example use RAK11200+RAK18003+RAK18030, and based on WIFI. After connection, the PDM will listen and report a alarm to remote server with TCP when triggered.
When use in local, it is just a alarm with a buzzer.
The Cyberon Software provides the ability of RAKwireless customers to enable voice control within their WisBlock System. The Cyberon software allows for the detection of specified voice triggers or commands. These commands are stored in a file which the customer links in when building their code.
Cyberon provides a set of tools to create these models. When the software is provided to customers RAK will provide one (or more) “standard” models to be used by makers and for evaluation of commercial customers. Currently the Cyberon Software can run on two different “platforms” within the WisBlock Audio:
We provide three standard mode now as below, first and second is for local device control and third is for LoRaWAN node.
Function | Trigger | Commands |
---|---|---|
Music | “Hey RAK Star” | “Play Music”, “Stop Music”, “Previous Song”, “Next song”, “Volume Up”, “Volume Down”, “Stop”, “Pause”, “Next”, “Resume”, “Previous”, “Volume Up”, “Volume Down”, “Increase Volume”, “Decrease Volume” |
Light Contrrol | “Hey RAK Star” | "Turn Lights on”, “Turn Lights off”, “Lights on”, “Lights off”, “Turn lights up”, “Turn lights down”, “Dim lights”, “Brighten lights”, “Lights Red”, “Lights Blue”, “Lights Green”, “Lights Yellow”, “Lights Orange”, “Lights Pink” |
WisDM | “Hey RAK Cloud“ | “Connect”, “Disconnect”, “Report Location”, “Get Status”, “Report Battery“,“Report Environment”, “Reset” |
WisCore
WisDM
This examples use RAK4631+RAK18003+RAK18030. When say "Connect", it will connect to the lora server, and of course, you need to make some configuration, like DEVEUI, APPEUI... If you want to use TTN, same as well.
RGB
This example use RAK19001+RAK4631+RAK18003+RAK14001+RAK18030. When say "Turn Lights on", the RGB will on. And you can test other commands, like “Lights Pink”, it will be pink.
DSPG
Music
This example use RAK18030/1/2+RAK18003+RAK18060+RAK18080+RAK11200.When say the trigger words wakes up the WisCore then say command words it will print the recognized command and ID number by serial port.
Because of the limitation of hardware, we only support record/play WAV file via SD card on RAK11200.
Record to SD
note:This example need use the battery power for WisBase.
This example use RAK11200+RAK18003+RAK18030+SD card. And you can modify the parameter, like frequence, channel or date bit.
Then you will find the record file in the SD card.
This example use RAK11200+RAK18003+RAK18060+Speaker+SD card. And first store the WAV file in SD card and modify the name to "test".
Then download the example and play. It can detect the different format of WAV in the SD card and play "test.wav".
First you need put your WAV file with the WAVconvert.py in the same folder.
Second, run the CMD console program.
Third, enter the "python ./WAVconvert.py" command and run .If your computer not installed the Python environment you can download the python by this link:https://www.python.org/downloads/.
After convert done, the converted .h file name is the same as your WAV name.
Then, open the .h file and copy the sound buffer to replace the example's sound buffer.