Audio Core
Introduction
The SPARK Audio Core is the piece of software used by all SPARK-based audio applications. Its role is to manage audio samples flow from their recording to their playback, including audio processing and buffering. The Audio Core will mostly be used in conjunction with the SPARK Wireless Core, but it has been built in such a way that it is not dependant on it. A few abstractions like audio pipelines, audio endpoints and audio processing stages make it flexible and decoupled from other libraries and hardware.
Most of the Audio Core features are demonstrated using application examples found in the SPARK SDK. Those are the best place to start learning about how to use the Audio Core while reading through this documentation. Sections in the documentation have been ordered from a top-down perspective, which means it starts by speaking about application requirements, then the Audio API and finally the Audio Core itself.
End-User Application
The end-user’s application must take care of a few things before the Audio Core can be operational. First, it must initialize and configure the endpoints it wishes to use. In the case of endpoints that rely on hardware, such as a hardware audio codec, the application would need to:
Initialize MCU’s peripherals that interface with it like the I2S and I2C controller
Configure it to have, for example, the proper sampling rate and bias voltage
Manage its interrupt service requests or the ones of the MCU’s peripherals
In most cases, the application will also use the SPARK Wireless Core as an endpoint for sending or receiving audio samples over the air. If so, the Wireless Core will need to be configured by the application using the Wireless Core API.
Once the endpoints dependencies are taken care of, the application will need to make sure it can make available a chunk of RAM big enough for the Audio Core to initialize properly. The Audio Core will then be able to dynamically allocate memory from this pool to create the audio buffers amongst other things. The chunk of RAM is usually just a statically allocated bytes array.
Finally, Audio Core objects can be created and configured. Those are the endpoints themselves, the processing stages, and the pipelines.
A few audio application examples are available in the SPARK SDK that the user can use as a starting point.
Audio Core Components
The Audio Core is composed of several interacting components that will be described in this section.