Superpowered Update 2.5.0

Gabor Szanto

Happy Day After Valentine’s Day. No roses from us this year – but instead a fragrant bouquet of Superpowered 2.5.0 new API calls, fixes and deprecations from the Superpowered engineering team.

Huh?

All Audio IO Is Interleaved

The Superpowered SDK comes with a number of open-source audio I/O classes to set up platform-specific (eg iOS or Android etc) real time audio input and/or output.

The implementation of these reflects the characteristics of the specific platform, therefore the API for each one is slightly different across them. We're working towards a unified and platform-agnostic API, and as the first and most important step, all of Superpowered audio IO is interleaved.

To support multi-channel (more than 2) interleaved audio and solve the connection to interleaved stereo Superpowered features, the following new high-performance APIs were added to SuperpoweredSimple.h:

CopyMonoToInterleaved:
copy mono audio into any channel of an interleaved buffer.
CopyMonoFromInterleaved:
copy a single channel in an interleaved buffer to a mono buffer.
CopyStereoToInterleaved:
copy stereo interleaved audio into any channel pair of an interleaved buffer.
CopyStereoFromInterleaved:
copy a channel pair in an interleaved buffer to a stereo interleaved buffer.

Additionally, the new GetPeaks function can provide metering for a buffer with any number of interleaved channels.

Every I/O class became channel-number agnostic, except on Android. Which means that you can set the number of channels your application provides or consumes independently from the current channel number of the device.

Initialize Is Shorter And Easier

The Initialize function takes a single license key now, every other argument is removed. We often see developers using (and failing) a license key created for a different platform, such as a license key registered for iOS in a macOS application.

Remember: this approach never works, please register a separate key for each platform.

Android Updates

The minimum supported Android version was once 19 (4.4 KitKat, 2013) and is now 22 (5.1 Lollipop, 2014), as such, Android Studio reports 97.3% support at the writing of this post. All example projects were updated to the most recent Gradle/Android SDK/Studio/etc. practices as well.

Windows Updates

Microsoft has deprecated UWP. So the UWP platform is not the future after all, therefore all the example apps were recreated for "traditional" Win32, since most developers including Superpowered on Windows use that. We think that the examples are more compact and easier to understand now. The new SuperpoweredWASAPIAudioIO class replaces the old UWP-based I/O to complete the transition.

In response to the release of Visual Studio 2022 we added support for the new v143 version, while removing the old v120 (2013) and v140 (2015) targets.

Apple Updates

The new "M" processor architecture adds another 64-bit ARM target next to the already present iOS one, therefore bundling multiple targets into a single .a file is not possible anymore. All Superpowered static libraries are now packaged into a single multi-target "xcframework", which is a convenient drag-and-drop way to include all Superpowered binaries in an Xcode project.

All example projects have been updated to use it. The "ambi" example was brought back to life and is now fully optimized with Superpowered components (the previous speaker calculation was replaced by a MonoMixer).

WebSDK JavaScript Updates

We added two new functions to the Superpowered object. memoryCopy implements a C-style memcpy, while memorySet does a memset. Both operate in the WebAssembly Linear Memory, providing an efficient way to copy or set memory there.

Happy Coding!

  • interleaved audio
  • uwp
  • win32
  • wasapi
  • superpowered