Coder Social home page Coder Social logo

superpoweredsdk / low-latency-android-ios-linux-windows-tvos-macos-interactive-audio-platform Goto Github PK

View Code? Open in Web Editor NEW
1.3K 105.0 284.0 1.2 GB

🇸Superpowered Audio, Networking and Cryptographics SDKs. High performance and cross platform on Android, iOS, macOS, tvOS, Linux, Windows and modern web browsers.

Home Page: https://superpowered.com

Java 8.91% C++ 52.12% C 0.95% Objective-C 11.43% Objective-C++ 22.70% Swift 0.92% Shell 0.21% CMake 0.93% Ruby 0.84% Kotlin 0.02% Dart 0.64% JavaScript 0.10% TypeScript 0.24%
cpp audio midi usb-audio cryptography https json aes rsa hashing android ios linux windows webassembly spatialization hls fft time-stretch macos

low-latency-android-ios-linux-windows-tvos-macos-interactive-audio-platform's Introduction

Superpowered Inc develops the leading portable C++ Audio SDK, C++ Networking SDK, and C++ Crypto SDK featuring low-power and real-time latency. With builds for Desktop, Mobile, IoT and Embedded Devices, portable and cross-platform on Android, iOS, macOS, tvOS, Linux and Windows as well as processor-specific builds for ARM32, ARM64, x86, and x64.

Technology, SDKs and Code

Superpowered Inc develops the following interactive audio, networking and cryptographics SDKs and infrastructure:

1. Superpowered C++ Audio Library and SDK for Android, iOS, macOS, tvOS, Linux and Windows.

Superpowered C++ Audio Library and SDK is the leading C++ Audio Library featuring low-power, real-time latency and cross-platform audio players, audio decoders, Fx (effects), audio I/O, streaming, music analysis and spatialization.

For the most up-to-date feature list, see: https://superpowered.com/audio-library-sdk For the latest API reference check the docsite: https://docs.superpowered.com/reference/latest?lang=cpp

2. Superpowered C++ Networking Library and SDK for Android, iOS, macOS, tvOS, Linux and Windows.

The Superpowered C++ Networking Library and SDK was designed from the ground-up to provide the easiest cross-platform way for a client to communicate with the back-end. It implements HTTP and HTTPS communication with custom data and header support, progress handling, file uploads/downloads and more. It reduces implementation, debug and maintenance time of typical tasks such as REST API requests, OAuth and bearer token authorization, or digital media streaming. It operates identically on all platforms, removing the pain of writing wrappers and finding quirks around the operating system's networking API, while it's fully self-contained and independent from it. The SDK also has a JSON parser to offer a complete package for your everyday networking and parsing needs.

For the most up-to-date feature list, see: https://superpowered.com/networking-library-sdk

3. Superpowered C++ Cryptographics Library and SDK for Android, iOS, macOS, tvOS, Linux and Windows.

Superpowered Crypto offers the easiest cross-platform way to implement RSA public and private key cryptography, AES encryption and hashing functions (SHA, MD5). Unlike other cryptographics libraries designed for crypto enthusiasts with myriads of options and complex APIs, Superpowered Crypto has direct one-liner calls for signing, verification, encryption and decryption, solving the most common use-cases in the quickest way.

For the most up-to-date feature list, see: https://superpowered.com/crypto-library-sdk

4. Superpowered HLS (HTTP Live Streaming) audio for Android, iOS, macOS, tvOS, Linux and Windows.

  • VOD, live or event streams.
  • AAC-LC or MP3 audio encoding.
  • ADTS AAC, MP3 or MPEG-TS containers.
  • Supports byte range requests and AES-128 encryption.
  • Bandwidth measurement and selectable automatic stream switching.
  • Selectable download strategies.

Background information: https://superpowered.com/http-live-streaming-for-android-superpowered-android-audio-io-and-audio-resampler

5. Superpowered USB Audio and USB MIDI for Android

The Superpowered USB Audio and MIDI features for Android takes over MIDI device handling, providing low latency and low jitter (below 2 ms) access to MIDI devices for 1.4 billion Android devices, that is, 90+% of all Android devices on Google Play. It’s the Android equivalent of iOS Core Audio and Core MIDI for USB devices.

For additional info, please see: https://superpowered.com/android-usb-audio-android-midi

6. Superpowered has developed a system-space solution for Android's 10 ms Problem.

Interested parties should read:

https://superpowered.com/android-audio-low-latency-primer https://superpowered.com/superpowered-android-media-server

Supported Platforms

Superpowered is cross-platform: ALL SUPERPOWERED C++ CODE CAN BE COPY-PASTED between Android, iOS, macOS, tvOS, Linux and Windows.

Folders

  • /Superpowered

    The SDKs (static libraries and headers).

  • /License

    Contains the license document and Superpowered logo assets.

  • /Examples_Android

    Example projects for Android.

  • /Examples_iOS

    Example projects for iOS.

  • /Examples_Linux

    Example projects for Linux.

  • /Examples_tvOS

    Example projects for tvOS.

  • /Examples_Windows

    Example projects for Windows.

  • /Examples_macOS

    Ambisonics (b-format) implementation based on the Superpowered Spatializer.

  • /Examples_Flutter

    Example projects for Flutter.

  • /Examples_ReactNative

    Example projects for React Native.

  • /Examples_VisionOS

    Example projects for visionOS.

Example Projects

/Examples_Windows/SuperpoweredExample.sln

Four simple Universal Windows Platform example projects in a single Visual Studio solution. Shows how to:

  • Set up audio I/O.
  • Use a single player to play an MP3 bundled with an app.
  • Use a single player to play HLS content.
  • Record the microphone input using Superpowered Recorder.
  • Use a single effect (input -> fx -> output).

/Examples_iOS/SuperpoweredCrossExample, /Examples_Android/CrossExample

A fully-functional DJ app project example. Shows how to:

  • Set up audio I/O.
  • Set up two players.
  • Sync them together.
  • Apply some effects on the master mix.
  • Use Objective-C++.

/Examples_iOS/SuperpoweredFrequencyDomain, /Examples_Android/FrequencyDomain

Simple time domain to frequency domain transformation with buffering and windowing. Shows how to:

  • Set up audio I/O.
  • Use the SuperpoweredFrequencyDomain class.
  • Process the magnitudes and phases of the audio input.

/Examples_iOS/uperpoweredHLSExample, /Examples_Linux/src/hls.cpp

HTTP Live Streaming example project.

/Examples_iOS/SuperpoweredOfflineProcessingExample, /Examples_Linux/src/offlineX.cpp

Advanced example. Decodes an audio file, applies an effect or time stretching and saves the result in WAV. Shows how to:

  • Set up the Superpowered Decoder.
  • Apply a simple effect.
  • Use the time stretcher with an efficient dynamic memory pool.
  • Save the result in WAV.
  • Directly read from the iPod music library.
  • Use the offline analyzer to detect bpm and other information.

/Examples_iOS/SuperpoweredFrequencies

Simple 8-band frequency analyzer. Shows how to:

  • Mix Swift and Objective-C++ in a project.
  • Use the Superpowered BandpassFilterbank.

/SuperpoweredPerformance (iOS)

It compares several Superpowered features to Core Audio.

  • Shows the differences between Superpowered and Core Audio.

  • Syncs effects to the player's bpm.

  • Shows how to use Objective-C++ in an Objective-C project.

    Swift note: We have also tried creating this project in Swift, but it's not complete for audio and several features were impossible to implement (such as proper performance measurement). Swift is not designed for real-time audio. Fortunately, Objective-C++ files work great in Swift projects.

/Examples_Android/SuperpoweredEffect

Shows how to use a single effect (input -> fx -> output).

/Examples_Android/SuperpoweredPlayer

Shows how to use a player (for local, progressive download or HLS playback).

/Examples_Android/SuperpoweredRecorder

Shows how to record the microphone input using Superpowered Recorder.

/Examples_macOS/ambi (OSX)

Simple ambisonics implementation based on the Superpowered Spatializer.

/Examples_Android/SuperpoweredUSBExample

This project comes with two example apps, a simple and a complex example app.

Simple USB Example App:

The simple example app demonstrates an easy audio setup, similar to how iOS handles USB audio devices. It also receives and displays MIDI. The audio functionality of the simple example app will cover most mobile audio use cases.

Complex USB Example App:

The complex example app demonstrates full USB audio discovery, for the use case of sophisticated DAW and recording apps. It displays the various input and output options, audio paths and hardware controls of a USB audio device. Hardware controls can be manipulated and advanced thru audio paths can be enabled.

If an audio output is selected without an audio input, the complex example sends a sine wave to every output channel. If both audio output and audio input are selected, then loopback or round-trip latency measurement are available.

This means that the complex example app is also a testing tool to discover a USB audio device’s advanced features, test audio quality, glitches and latency.

/Examples_Flutter/SuperpoweredPlayerWithEffects

Shows how to use a player and apply a single effect.

/Examples_ReactNative/SuperpoweredPlayerWithEffects

Shows how to use a player and apply a single effect.

/Examples_VisionOS/SuperpoweredVisionOSExample

Shows how to generate a sine wave.

Remarks:

Superpowered USB Audio classes for Android are compatible from Android 19 (KitKat 4.4) onwards. That’s the first Android version where proper scheduling priorities were implemented for low latency audio. This covers more than 75% active Android devices today.

Android Studio

Before running any Android example project, please install the Android NDK version 25.1.8937393 (Tools → SDK Manager → SDK Tools → NDK (Side by side)). Furthermore, turn off Instant Run in the settings, because the Instant Run feature of Android Studio is not compatible with native C++ Android projects.

How to create a Superpowered project with Android Studio

Prerequisites: latest Android SDK, Android NDK, Android Studio installed. Steps:

  1. Create a new project in Android Studio.
  2. Create the cpp folder inside the project's folder: app/src/main/jni
  3. Copy the contents of the following files from one of the example projects: gradle/wrapper/gradle-wrapper.properties, build.gradle, app/build.gradle, app/CMakeLists.txt
  4. Open build.gradle (Module: app), and change the applicationId

Support

Superpowered offers multiple support options.

Developer Documentation (C++ and JavaScript): https://docs.superpowered.com

Email: [email protected]

Knowledge base: https://superpowered.zendesk.com/hc/en-us

StackOverflow: https://stackoverflow.com/search?tab=newest&q=superpowered

YouTube: https://www.youtube.com/playlist?list=PLtRKsB6a4xFMXJrZ9wjscOow3nASBoEbU

Paid support options: https://superpowered.com/support

Licensing

For details, please see: https://superpowered.com/licensing

For licensing inquiries, please email [email protected].

Custom Application Development Services

Superpowered offers custom development services focusing on low-latency, interactive audio applications for mobile, web, desktop and embedded.

For development inquiries, please email [email protected].

Contact

If you want to be informed about new code releases, bug fixes, general news and information about Superpowered, please email [email protected].

For licensing inquiries, please email [email protected].

Notes

Superpowered FFT benefits from ideas in Construction of a High-Performance FFT by Eric Postpischil (http://edp.org/resume.htm).

The Superpowered MP3 and AAC decoder benefits from optimizations by Ken Cooke.

Superpowered version 2.6.7

low-latency-android-ios-linux-windows-tvos-macos-interactive-audio-platform's People

Contributors

balazsbanto avatar gaborszanto avatar ivannador avatar vlaskovits avatar yonitsafir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

low-latency-android-ios-linux-windows-tvos-macos-interactive-audio-platform's Issues

The Audio processing effect occurs on all audio players

I have created 5 audio players. And I have created 5 different equalizer objects. The issue with the equalizer is that the equalizer of the first player works correctly and changes the audio for the first player. But the equalizer of second track changes the value of both first as well as second player. Similarily 3 one for all 3 audio players. Can't I set the equalizer to work only for specific audio player?

FrequencyDomain (Android) doesn't work on Google's emulator

Hi,

I wanted to try the new Superpowered version, but it seems that the FrequencyDomain project doesn't work (at least on Google's emulator, Nexus 5 with Lollipop 5.0).

Here's the stacktrace :

04-29 10:43:44.280      359-382/system_process I/ActivityManager﹕ Displayed com.superpowered.frequencydomain/.MainActivity: +3s800ms (total +3m3s81ms)
04-29 10:43:50.455       66-171/? W/AudioFlinger﹕ write blocked for 598 msecs, 4 delayed writes, thread 0xb61ba000
04-29 10:43:51.087      66-1227/? W/AudioFlinger﹕ RecordThread: buffer overflow
04-29 10:43:55.182    1210-1229/com.superpowered.frequencydomain A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x2d6087c1 in tid 1229 (RenderThread)
04-29 10:43:55.204    1210-1210/com.superpowered.frequencydomain A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x19 in tid 1210 (frequencydomain)
04-29 10:43:55.327    1085-1085/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-29 10:43:55.333    1085-1085/? I/DEBUG﹕ Build fingerprint: 'generic/sdk_phone_armv7/generic:5.0/LRX09D/1504858:eng/test-keys'
04-29 10:43:55.336    1085-1085/? I/DEBUG﹕ Revision: '0'
04-29 10:43:55.338    1085-1085/? I/DEBUG﹕ ABI: 'arm'
04-29 10:43:55.342    1085-1085/? I/DEBUG﹕ pid: 1210, tid: 1229, name: RenderThread  >>> com.superpowered.frequencydomain <<<
04-29 10:43:55.343    1085-1085/? I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x2d6087c1
04-29 10:43:55.427    1085-1085/? I/DEBUG﹕ r0 3c46818d  r1 b5200000  r2 3c46818d  r3 00000109
04-29 10:43:55.433    1085-1085/? I/DEBUG﹕ r4 a75690b0  r5 a7569000  r6 af5e2580  r7 b6fe0f68
04-29 10:43:55.438    1085-1085/? I/DEBUG﹕ r8 00000006  r9 a7569090  sl b6f817dd  fp b6fe0f78
04-29 10:43:55.441    1085-1085/? I/DEBUG﹕ ip b6fd4850  sp a72ffc88  lr b6fb44c7  pc b6fb4642  cpsr 20000030
04-29 10:43:55.446    1085-1085/? I/DEBUG﹕ backtrace:
04-29 10:43:55.449    1085-1085/? I/DEBUG﹕ #00 pc 00048642  /system/lib/libc.so (ifree+665)
04-29 10:43:55.463    1085-1085/? I/DEBUG﹕ #01 pc 0001261b  /system/lib/libc.so (free+10)
04-29 10:43:55.467    1085-1085/? I/DEBUG﹕ #02 pc 0001cb37  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderTask::~RenderTask()+18)
04-29 10:43:55.470    1085-1085/? I/DEBUG﹕ #03 pc 0003ce0f  /system/lib/libhwui.so
04-29 10:43:55.474    1085-1085/? I/DEBUG﹕ #04 pc 0003e1a3  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+66)
04-29 10:43:55.493    1085-1085/? I/DEBUG﹕ #05 pc 00010529  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112)
04-29 10:43:55.494    1085-1085/? I/DEBUG﹕ #06 pc 0005e06d  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+72)
04-29 10:43:55.500    1085-1085/? I/DEBUG﹕ #07 pc 00010099  /system/lib/libutils.so
04-29 10:43:55.504    1085-1085/? I/DEBUG﹕ #08 pc 000157fb  /system/lib/libc.so (__pthread_start(void*)+30)
04-29 10:43:55.514    1085-1085/? I/DEBUG﹕ #09 pc 0001381f  /system/lib/libc.so (__start_thread+6)
04-29 10:43:55.933       66-171/? I/AudioFlinger﹕ BUFFER TIMEOUT: remove(4097) from active list on thread 0xb61ba000
04-29 10:43:56.883    1085-1085/? I/DEBUG﹕ Tombstone written to: /data/tombstones/tombstone_08

I will try on my phone later to see if I can launch it.

Toggleplayback not working on app suspended...

To summarise what i am saying:

  1. App is playing fine when i lock the phone.
  2. I am using core motion to see if user is stationary or not.
  3. If user is moving the app keeps playing the music.
  4. User stops and the music is paused.
  5. User starts moving again but music do not play again until I unlock the device.

Any thoughts?

Android SuperpoweredExample crashes on run

I compiled and ran the master pull of this library and tried running it on my HTC One (ARM processor) running Android 4.3 (API 18) and also on Emulation (4.4.2 and 4.3). I also tried compiling it on 4.4.2 (API 19) but I get the same error when the application opens each time:

screenshot_2014-09-04-17-03-54

I imported the Superpowered-Audio-SDK-master/Android/SuperpoweredExample into Eclipse ADT and am using adt-bundle-mac-x86_64-20140702. I didn't make any changes to the source code or dependencies.

I also tried both library files,
Superpowered-Audio-SDK-master/Android/libSuperpoweredARM.a
Superpowered-Audio-SDK-master/Android/SuperpoweredExample/jni/libSuperpoweredARM.a

Both don't work.

Here is a stack trace from ADT (errors only):

09-04 16:41:43.698: E/AndroidRuntime(14140): FATAL EXCEPTION: main
09-04 16:41:43.698: E/AndroidRuntime(14140): java.lang.UnsatisfiedLinkError: Couldn't load SuperpoweredExample from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.SuperpoweredExample-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.SuperpoweredExample-2, /system/lib]]]: findLibrary returned null
09-04 16:41:43.698: E/AndroidRuntime(14140):    at java.lang.Runtime.loadLibrary(Runtime.java:355)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at java.lang.System.loadLibrary(System.java:525)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at com.example.SuperpoweredExample.MainActivity.<clinit>(MainActivity.java:100)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at java.lang.Class.newInstanceImpl(Native Method)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at java.lang.Class.newInstance(Class.java:1130)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2426)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2574)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.app.ActivityThread.access$600(ActivityThread.java:162)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.os.Looper.loop(Looper.java:158)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at android.app.ActivityThread.main(ActivityThread.java:5789)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at java.lang.reflect.Method.invokeNative(Native Method)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at java.lang.reflect.Method.invoke(Method.java:525)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:843)
09-04 16:41:43.698: E/AndroidRuntime(14140):    at dalvik.system.NativeStart.main(Native Method)

I also tried directly installing the *.apk file:

$ adb install -r bin/SuperpoweredExample.apk 
4241 KB/s (32489599 bytes in 7.479s)
    pkg: /data/local/tmp/SuperpoweredExample.apk
Success

But upon tapping the "Superpowered Example" icon in the app drawer, I get the same crash error.

Does your SDK perform audio loopback? (Record while hearing voice in real time)

I'm trying to make a Karoake app where you can sing into the mic and hear yourself in real time with no latency (less enough where it is feasible to sing without being disturbed by your delayed echo).

Do you support this feature? How would you do it with your SDK? I didn't see an option to feed the audio-in into the audio-out.

how to estimate latency of an android device ?

Hello,

I have notice the /SuperpoweredPerformance (iOS) and the android app to test latency http://superpowered.com/latency/#axzz3bpJmBZ7c

I was wondering if there was a sample code to get estimated latency on android somewhere ?

I am considering using superpoweredSDK to build an app that will let people tap on their screen to create cued annotation (maybe in csv format), and I could highly benefit from knowing the latency of the device I'm on, and I should also probably worry about touch screen latency.

I'm not really used to C and C++ and I have a relatively low amount of time so I need to carefully consider before diving in. This sdk seems to be what I'm looking for any advice on the subject would be greatly appreciated.

Gradual pitch shift?

I saw in SuperAdvancedAudioPlayer.h that the following function shifts pitch:

/**
 @brief Sets the pitch shift value. Needs masterTempo enabled.

 @param pitchShift Note offset from -12 to 12. 0 means no pitch shift.
 */
    void setPitchShift(int pitchShift);

But the input is an int, and I need to pitch shift gradually from a whole or half-step lower to a whole or half-step higher, over, say, 2 seconds, gradually. i.e. setPitchShift(1.0); setPitchShift(0.99); setPitchShift(0.98); etc.

Is there any way to do this? I see pitchBend() but this is for temporary tempo change, not gradual pitch shift.

Thanks.

Need Example of Multiple SuperpoweredStereoMixer to process more than 4 songs - iOS

Hi, I need to mix more than 5 sonts parallely. But, SuperpoweredStereoMixer takes 4 songs at a time.

As mention in this thread:- #41

I need to make 2 audio mixers and the output of the first mixer will be added as the input of the second. But the problem I am facing is that for the second mixer, the buffer is the one that is received from

  • (bool)audioProcessingCallback:(float **)buffers inputChannels:(unsigned int)inputChannels outputChannels:(unsigned int)outputChannels numberOfSamples:(unsigned int)numberOfSamples samplerate:(unsigned int)samplerate hostTime:(UInt64)hostTime

But for the first mixer, how to create and initialize buffer.

Currently, I have done it in this way :-

//1 -> Create a new Buffer
float **outPutBuffers1_4;

//2 -> Initialize it in my class constructor
if (posix_memalign((void **)&outPutBuffers1_4, 16, 4096 + 128) != 0)
abort();

//3 -> Initialize Buffers for interleaved stereo
outPutBuffers1_4[0] = (Float32 *)malloc(sizeof(Float32) * numberOfSamples);
outPutBuffers1_4[1] = (Float32 *)malloc(sizeof(Float32) * numberOfSamples);

//4 -> Process this buffer

audioMixer->process(mixerInputs, outPutBuffers1_4, mixerInputLevels, mixerOutputLevels, NULL, mixerOutputMeter, numberOfSamples);

//5 - > Add this buffer in mixer Inputs
mixerInputs1[0] = *outPutBuffers1_4;
mixerInputs1[1] = outPutBuffer_5;
mixerInputs1[2] = outPutBuffer_6;
mixerInputs1[3] = outPutBuffer_7;

//5 - > Process it in outPutBuffer which I am getting from the audioProcessingCallback method
audioMixer->process(mixerInputs1, outPutBuffers, mixerInputLevels, mixerOutputLevels, NULL, mixerOutputMeter, numberOfSamples);

This does not work. I think the issue is withe the outputBuffer1_4 allocation and initialization as well as the way it needs to be assigned to mixerInputs1[0]

Please help with this......

"AudioFile Read" thread overflow when changing songs often (iOS)

Hi, I've used the library to implement a playlist, and come across an error that I'd appreciate some help with. During normal usage playing and paging between songs works fine. However, if I start to aggressively and repeatedly page through all the songs, I encounter this error.

What happens is that the callback to my SuperpoweredAdvancedAudioPlayer gets an error with the value "Slip thread launch error." Afterwards, I get a bunch of memory errors before the application crashes. If I look at the threads in my application process, I can see around two hundred "AudioFile Read" and "AudioFile Shadow" threads lying around, so it seems safe to say this is the underlying problem. These only appear after I call SuperpoweredAdvancedAudioPlayer::open, so I assume that the deal is some resources not being properly released when I open new songs.

My question is: are there any limitations on using SuperpoweredAdvancedAudioPlayer::open that would explain this, and is there a form of delete/release management that needs to be done between songs that I'm missing? I didn't find anything in the documentation for this case.

iOS How to open MPMediaItem audio File. (iTunes Audio file)?

I am able to process/play audio file either from Bundle or from the document directory but not able to access the audio file of iTunes directly. Do I need to write the audio file first in document directory using audio export session first and then use the file for further process? If yes, It will take lot of processing to write and then further process to analyze the song.

SuperpoweredAdvancedAudioPlayer cannot open short audio files (Android)

SuperpoweredSDK Version 0.8 for Android
Calling SuperpoweredAdvancedAudioPlayer::open() for an audio file (.m4a) with duration less than 2 seconds results in SuperpoweredAdvancedAudioPlayerEvent_LoadError. On iOS it works fine.

SuperpoweredAdvancedAudioPlayer *player;
player = new SuperpoweredAdvancedAudioPlayer(this, callback, "11025", 0);
player->open("/storage/emulated/0/myApp/AudioShort.m4a");

The LoadError value parameter returns the error description "Unknown file format".
Find a sample file here: www.eco-soft.ch/download/temp/audioshort.m4a

Record Audio And Mix With The Current Audio

Hello,

I'm working with an android project that will record an audio and mix that audio with the current audio is playing (like singing with the beat), finally it will export a new mp3 file.

Could you show me what classes do i need to implement it, or give an example.

Thank you so much !

Offline processing howto

How do I do offline processing? i.e. I want to play song A without processing, while time stretching song B and storing it in a temporary buffer. I can't figure out how to do this without sending B's processed buffer to the playback engine.

I suspect I would do this in the ndk portion of the code, possibly SuperpoweredAdvancedAudioPlayer.cpp but a code snippet would help. I see that your FAQ says:

"The SDK includes a simple offline processing example project too."

But I only found SuperpoweredOfflineProcessingExample which is for iOS, not Android.

Try SuperpoweredAdvancedAudioPlayer but no luck.

Hi dear developers! What I want to do is playing an audio sample file ( caf file ) with pitch shifting.
This is the audio file info:

File:           Sample.caf
File type ID:   caff
Num Tracks:     1
----
Data format:     1 ch,  44100 Hz, 'ima4' (0x00000000) 0 bits/channel, 34 bytes/packet, 64 frames/packet, 0 bytes/frame
                no channel layout.
estimated duration: 2.364036 sec
audio bytes: 55386
audio packets: 1629
bit rate: 187425 bits per second
packet size upper bound: 34
maximum packet size: 34
audio data file offset: 4096
optimized
audio 104254 valid frames + 0 priming + 2 remainder = 104256
source bit depth: I16

Code below is what I've tried:

void AdvancedAudioPlayerCallback(void *clientData, SuperpoweredAdvancedAudioPlayerEvent event, void *value)
{
    NSLog(@"==> %d, %s", event, (char *)value);
}

@interface SamplePlayer ()
{
    SuperpoweredAdvancedAudioPlayer *_player;
}

@end

@implementation SamplePlayer

- (instancetype) init
{
    self = [super init];
    if (nil != self)
    {
        [self setup];
    }

    return self;
}

- (void) setSourceFile:(NSString *)sourceFile
{
    if (_sourceFile != sourceFile)
    {
        _sourceFile = sourceFile;
        _player->open([_sourceFile fileSystemRepresentation]);
    }
}

- (void) setup
{
    _player = new SuperpoweredAdvancedAudioPlayer(NULL, AdvancedAudioPlayerCallback, 44100, 4);
    _player->setTempo(1.0, true);
}

- (void) dealloc
{
    delete _player;
}

// I want to play the audio 3 half steps higher, so I set pitchShift to 3 when I call this method.
- (void) play:(int)pitchShift
{
    _player->setPitchShift(pitchShift);
    _player->play(false);
}

The log from audio play callback says it was SuperpoweredAdvancedAudioPlayerEvent_LoadSuccess, but when I call the -[SamplePlayer play:] method, there was no sound came out.

Did I do something wrong?

Thanks!

Can not stop FrequencyDomain in FrequencyDomain Android Example

Hello,

I'm working with FrequencyDomain Example in Android Studio, the sound responses is very good. But I want to know how to stop the "Response" from FrequencyDomain Class.

Example :
String samplerateString = null, buffersizeString = null;
if (Build.VERSION.SDK_INT >= 17) {
AudioManager audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
samplerateString = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);
buffersizeString = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
}
if (samplerateString == null) samplerateString = "44100";
if (buffersizeString == null) buffersizeString = "512";

    System.loadLibrary("FrequencyDomain");
    FrequencyDomain(Integer.parseInt(samplerateString), Integer.parseInt(buffersizeString));

How can I stop FrequencyDomain ? Is there any method to stop it recording and responing

Record sound issue

Hi!
Currently working on recording with the microphone on Android. Faced with the problem: using class SuperpoweredRecorder.h fails to record from the microphone. I use the 'start' method with path params (//mnt//sdcard//Music//music.wav) and then stop() . No fails or fatals, but the file itself does not appear.

Can you provide me with right way for work with SuperpoweredRecorder.h on Android?
Thanks for the reply!

Two questions: WebRTC and Noise Canceling Algorithms

Have you considered the use of your library as part of a native WebRTC implementation (perhaps in conjunction with the GStreamer-based OpenWebRTC stack from Ericsson?

Also, do you have any implementation of noise cancellation in the SDK, or would this need to be handled as part of transcoding through Streamer for a WebRTC or audio conferencing app?

Do you have a Google Group set up for this project?

Audio Record using SuperpoweredRecorder API

It is easy to use API of Superpowered SDK. Well documented and clean.
I gave local path to tempPath and DestinationPath and called recorder process function in main audio process module. Like this.
// Recorder process
recorder->process(stereoBuffer, NULL, numberOfSamples);

The problem is just that I couldn't got recorded audio. It isn't produced recorded audio.
I hope the right answer or solution from highly skilled experts. Thanks

SuperpoweredBandpassFilterbank return NaN or Infinity

I was working on Android application which use Superpowered SDK for audio analysis 2 weeks ago.
App record audio using Android AudioRecorder class and pass recorded buffer to native library (NDK). I wrote simple JNI wrapper for Superpowered BandpassFilter to do that.

First issue was in Superpowered StereoMixer shortIntToFloat() function for audio conversion from short 16 bit to float 32 bit. Sometimes this convert function crashes with SIG ACCESS (as I understand access to wrong address). I respect rules in docs which says: input and output MUST be numOfSamples +8 big minimum and numOfSamples must be divisible by 8.

After long debugging I fix it by replacing this bogus function by simple for loop (on same data in same NDK level).

But, most critical issue in both cases (with Superpowered converter or my own loop) BandpassFilter sometimes starting return band array filled with NaN or Infinity values and continue doing so with new input (even if I recreate & init new BandPassFilter object). I was found it happens before my JNI return value to Java level and also I was checked my input audio buffer: it was always in correct range [-1,1] and do not content NaN or Infinite values. I use C++ 11 isnan() and isinf() functions to check each value in my input audio buffer. When I check output bands values using same functions it was NaN or Infinite (in case when issue shows up).

This issues happens not always, but frequent. Which makes imposible to use Superpowered in project even if it works sometimes.
I can share some code if you request.

My testing device: Nexus 5 (Android 5.1).
Audio sample rate 44100, stereo.
Superpowered SDK ver 0.7.1
Android NDK ver: android-ndk-r10d

Need help and examples

Hi! Iam very exited with the features of this SDK!!
Im relativity new to android programming and need some help to get this work.
I have the android example working ok but i dont know if the library compiled with all classes. If i try to use ie SuperpoweredRecorder eclipse said that the class dont exist.

With the SDK downloaded, wich are the steps to get an empty project ready to use with all the superpowered sdk features?
Can you give me some examples to implement recording and playback with timestreching using the sdk in android?

Thanks!!!

SuperpoweredStereoMixer issue

Hi
I've faced with very strange issue.
My task is overlaying input voice on background music.
I use SuperpoweredAndroidAudioIO from example for this.
I get voice callback for voice and for music correctly, after that i try to mix it

    inputs[0]=voiceBuffer;
    inputs[1]=stereoBuffer;

    outputs[0]=comboBuffer;

    inputLevels[0]=1.0f;
    inputLevels[1]=1.0f;
    inputLevels[2]=1.0f;
    inputLevels[3]=1.0f;
    inputLevels[4]=1.0f;
    inputLevels[5]=1.0f;
    inputLevels[6]=1.0f;
    inputLevels[7]=1.0f;


    outputLevels[0]=1.0f;
    outputLevels[1]=1.0f;
    float inputMeters[8];
    float outputMeters[2];

        mixer->process(inputs,outputs,inputLevels,outputLevels,inputMeters,outputMeters,numberOfSamples);

On last row (mixer-process ) sometimes i have crash my app (one of this):

A/libc? Fatal signal 11 (SIGSEGV), code 2, fault addr 0x42c05f1f in tid 15455 (AudioTrack)

06-29 12:49:36.662 15663-17042/ry.aat.dev A/libc? Fatal signal 11 (SIGSEGV), code -6, fault addr 0x3d2f in tid 17042 (AudioTrack)

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c

A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x76c62405 (code=1), thread 14368

Can you make me some idea about resolving this issue? Thanks

Any tutorials for this SDK ?

Hello =)

I wish to use your SDK, but I'm a total newbie and I'm not sure about how to begin using it. I come from the web, so I am not an expert in C/C++ ^^'.

I would like to know if there is any tutorial for this SDK ? I already saw the example for Android (as I want to make an Android app), but tre truth is that I am a little lost with the files and how it works.

If it can be of any help, I want to make an app simulating a guitar amplifier in real time (this means hard clipping / soft clipping of a signal to make the distortion / overdrive sounds, and some other effects that I could add.

Example request

I will be grateful if you provide any example how to use SuperpoweredEcho or reverb with offlineProcess in as you provide for SuperpoweredTimeStretching iOS

Quick example of mike capture -> SuperpoweredAdvancedAudioPlayer

Hi Gabor,
I have read with interest your credo on site, the DJ video and appreciated the fast handshake from Patrick after SDK download. I've also did a succesfull Eclipse install of your Android example. Basically I am at ease with JNI but I would kindly ask you, to save "decryption" time, if possible, to drop the few lines of code for your player reading from a float (I imagine) buffer, so that I can test your challenging statement on the low latency performance, before playing with the special effects on Android; I shall use it with voice capture. Besides the fast processing algos, my understanding is that this latency reduction - your original catch - comes from the audio player implementation (not the mike capture input, at least for Android). Thanks for considering this inquiry, I shall post here my implementation if okay.

OnCompletionListener

Android. How to listen OnCompletion of tracks? Are you going to implement this function?

How to mix a track and export it to a file

Hi!
I want to change pitch of a track and save result into a file (like add baby-effect into a music).
I can change pitch, it's so easy with SupperPoweredSDK but I don't know how to export.
Can SupperPoweredSDK do that?

Thanks

Audio files mixing incomprehension

Does it only one way to mixing two or more audio files using synchronized SuperpoweredAdvancedAudioPlayers? And how should i set offset from start of composition for audio files? As i understand for multi-track system with ability of mixing samples in one track i should create player for every different sample. Can it cause a problem if i have more than hundred different samples. So now i see possibility to use this great SDK for creating DJ app but can't understand how can i clearly use it for multi-track mixer. thx

SuperpoweredAndroidIO and different samplerates

Hello,

I would to know if it is possible to have different sample rates when using the AndroidIO class ? In my case, my input sample rate will be lower than the output. How could I do that, or what can I do to make it compatible ?

CrossExample full of static on a test device

Hi, I have two devices I'm testing CrossExample app on. First one is Nexus 9 with Android 5.0.1, no problems there. Second is HTC One (m7) Google Play Edition with Android 4.4.4 (Beats Audio turned off). The CrossExample project generates static when playing (just playing, not messing with UI controls), as if the a buffer is under run. It gets worse when home key is pressed and app goes into background. I can run the NativeAudio sample project included with NDK with no problems, and even alter the code for it to be in background with no problem.
The only thing I can notice from the log is excessive V/AudioMixer enable and disable many times per second when the app starts playing. This does not occur with NativeAudio example app or on Nexus 9.

04-25 16:04:59.851 269-651/? D/AudioStreamOutALSA﹕ write:: buffer 0xb7de8788, bytes 1024
04-25 16:04:59.861 269-651/? V/AudioMixer﹕ disable(1)
04-25 16:04:59.871 269-651/? V/AudioMixer﹕ enable(1)
04-25 16:04:59.871 269-651/? V/AudioMixer﹕ disable(1)
04-25 16:04:59.871 269-651/? V/AudioMixer﹕ enable(1)
04-25 16:05:00.001 269-651/? V/AudioMixer﹕ disable(1)

This happen with superpoweredSDK 0.8 and android-ndk-r10d

It doesn't happen on any other audio apps. Only time I have seen is when using very small buffer size with Java SDK AudioTrack.

Please help I don't know enough about OpenSL to debug yet.

Needs more example for offline processing

I try to process audio files by applying both SuperpoweredTimeStretching and other filters (i.e SuperpoweredWhoosh) and finally save to a file. However, the offline-processing example only tutors about SuperpoweredTimeStretching and the interface between SuperpoweredFX and SuperpoweredTimeStretching is quite different.

process (float *input, float *output, unsigned int numberOfSamples)
process (SuperpoweredAudiobufferlistElement *input, SuperpoweredAudiopointerList *outputList)

I'm not expert in c/c++, plz shed me some light and sample codes, that will save my life. Appreciate!

Understanding CrossExample - LoadPlayerA()

Hi :)
I just played around with the CrossExample to understand how it works.. so I got the EQ and Effects running, but after long try&error I just can't figure out how to set up only one Player(?) ..

So I have my File-Select in Java and on the OnClicklistener I tried to call a modified copy of the SuperpoweredExample-Method ..

void SuperpoweredExample::LoadPlayerA(const char *audioPath, int *params) {
pthread_mutex_init(&mutex, NULL); // This will keep our player volumes and playback states in sync.
unsigned int samplerate = params[4], buffersize = params[5];
stereoBuffer = (float *)memalign(16, (buffersize + 16) * sizeof(float) * 2);

playerA->pause();
delete playerA;
playerA = new SuperpoweredAdvancedAudioPlayer(&playerA , playerEventCallbackA, samplerate, 0);
playerA->open(audioPath, params[0], params[1]);

playerA->syncMode = playerB->syncMode = SuperpoweredAdvancedAudioPlayerSyncMode_TempoAndBeat;

audioSystem = new SuperpoweredAndroidAudioIO(samplerate, buffersize, false, true, audioProcessing, this, 0);
}

and in my Java-Code

fis = new FileInputStream(audioPath);
fd = fis.getFD();
File home = new File(audioPath);
int length = (int) home.length();
long[] params = {
                            0,
                            length,
                            Integer.parseInt(samplerateString),
                            Integer.parseInt(buffersizeString)
                    };
LoadPlayerA(audioPath, params);

can someone push me in the right direction? .. whatever I do.. the new track is loaded to PlayerA, and the previous track of playerA is playing overall :/

OfflineAnalyzer causes ANR on Android

I've been trying out the SuperpoweredOfflineAnalyzer on Android, but can't seem to get it to work in a predictable manner. Sometimes it works splendidly (usually the first time it's called) but on subsequent calls it completely freezes on analyzer->getresults(...). My first instinct is that it's a memory leak but I can't find anything that isn't being freed or deleted. Any thoughts?

My code (based on offline processing sample and the example given in #11):

#define LOG_TAG "NativeAnalyzerWrapper"

SuperpoweredDecoder* NativeAnalyzerWrapper::newSongDecoderForFilePath(const char *path) {
    SuperpoweredDecoder *decoder = new SuperpoweredDecoder(false);
    const char *openError = decoder->open(path);
    if (openError != NULL) {
        __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "Decoder error: %s", openError);
        delete decoder;
        return NULL;
    }
    return decoder;
}

void NativeAnalyzerWrapper::processSong(const char* path) {
    SuperpoweredDecoder *decoder = newSongDecoderForFilePath(path);
    if (decoder == NULL) {
        __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "Decoder was not created");
        return;
    }

    int sampleRate = decoder->samplerate;
    double durationSeconds = decoder->durationSeconds;

    SuperpoweredAudiobufferPool *bufferPool = new SuperpoweredAudiobufferPool(4, 1024 * 1024);             // Allow 1 MB max. memory for the buffer pool.
    SuperpoweredOfflineAnalyzer *analyzer = new SuperpoweredOfflineAnalyzer(sampleRate, 0, durationSeconds);

    short int *intBuffer = (short int *)malloc(decoder->samplesPerFrame * 2 * sizeof(short int) + 16384);

    __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "Processing...");
    int samplesMultiplier = 1;
    while (true) {
        // Decode one frame. samplesDecoded will be overwritten with the actual decoded number of samples.
        unsigned int samplesDecoded = decoder->samplesPerFrame * samplesMultiplier;
        unsigned int lastDecoded = samplesDecoded;
        if (decoder->decode(intBuffer, &samplesDecoded) != SUPERPOWEREDDECODER_OK) break;

        // Create an input buffer for the analyzer.
        SuperpoweredAudiobufferlistElement inputBuffer;
        bufferPool->createSuperpoweredAudiobufferlistElement(&inputBuffer, decoder->samplePosition, samplesDecoded + 8);

        // Convert the decoded PCM samples from 16-bit integer to 32-bit floating point.
        SuperpoweredStereoMixer::shortIntToFloat(intBuffer, bufferPool->floatAudio(&inputBuffer), samplesDecoded);
        inputBuffer.endSample = samplesDecoded;             // <-- Important!
        analyzer->process(bufferPool->floatAudio(&inputBuffer), samplesDecoded);
    }

    delete decoder;
    delete bufferPool;
    free(intBuffer);

    unsigned char **averageWaveForm = (unsigned char **)malloc(150 * sizeof(unsigned char *));
    unsigned char **peakWaveForm = (unsigned char **)malloc(150 * sizeof(unsigned char *));
    char **overViewWaveForm = (char **)malloc(durationSeconds * sizeof(char *));

    int *keyIndex = (int *)malloc(sizeof(int));
    int *waveFormSize = (int *)malloc(sizeof(int));

    float *averageDecibel = (float *)malloc(sizeof(float));
    float *loudPartsAverageDecibel = (float *)malloc(sizeof(float));
    float *peakDecibel = (float *)malloc(sizeof(float));
    float *bpm = (float *)malloc(sizeof(float));
    float *beatGridStart = (float *)malloc(sizeof(float));

    __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "Analyzing...");

    analyzer->getresults(averageWaveForm, peakWaveForm, waveFormSize, overViewWaveForm, averageDecibel,
        loudPartsAverageDecibel, peakDecibel, bpm, beatGridStart, keyIndex);

    __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "Done!");
//    notifyFinished(path, *averageDecibel, *loudPartsAverageDecibel, *peakDecibel,
//        *bpm, *beatGridStart);

    delete analyzer;
    free(averageWaveForm);
    free(peakWaveForm);
    free(overViewWaveForm);
    free(keyIndex);
    free(waveFormSize);
    free(averageDecibel);
    free(loudPartsAverageDecibel);
    free(peakDecibel);
    free(bpm);
    free(beatGridStart);
}

Relevant parts of the ANR report:

"main" prio=5 tid=1 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x41629ca8 self=0x41563408
  | sysTid=3196 nice=0 sched=0/0 cgrp=apps handle=1074778452
  | state=R schedstat=( 22049518248 801652505 10045 ) utm=2151 stm=53 core=0
  #00  pc 00009a0c  /data/app-lib/com.app.name-1/libNativeAnalyzer.so (beatgrid::process(float, unsigned int, float*, float*, float*, double)+1700)
  #01  pc 0000836c  /data/app-lib/com.app.name-1/libNativeAnalyzer.so (SuperpoweredOfflineAnalyzer::getresults(unsigned char**, unsigned char**, int*, char**, float*, float*, float*, float*, float*, int*)+1740)
  #02  pc 00005cbd  /data/app-lib/com.app.name-1/libNativeAnalyzer.so (NativeAnalyzerWrapper::processSong(char const*)+460)

Ogg support

Are there any plans to add ogg file support?

Getting silence=True occasionally during process()

I'm running SuperpoweredAdvancedAudioPlayer in thread1 which is audible. Separately, on another thread2 I'm calling SuperpoweredAdvancedAudioPlayer process() through iteration and writing the output to a raw PCM file.

thread1 (the audible thread) plays without any gaps. thread2, however, returns silence=True occasionally (every 10-30 seconds randomly) in the output of process(), which is time stretching.

I tried discarding the silence=True stereoBuffer and only write the stereoBuffer to file if silence=False. That seemed to help a bit to eliminate the silent regions, but I'm still getting 512 (outputBuffer)-length regions of the output audio which seem to be inserting a linear ramp between the previous 512-region and the next 512-region. These sound like audible blips/gaps when I playback the audio, which is not good.

How do I get rid of these silence=True regions? Am I failing to zero a buffer? I tried calling playerC->lastProcessMs() but it reports 11.609977 (512 frames) even if silence=True, so that didn't work.

Thanks!

How can you sync both tracks to 80 bpm in the CrossExample?

I tried calling:
playerA->setTempo(80.0f/126.0f, true);
by itself, and:
playerA->setTempo(80.0f/126.0f, true);
playerB->setTempo(80.0f/123.0f, true);

I also set both to 80.0f/123.0f or both to 80.0f/126.0f.

They both slow down but they are no longer in sync. How can I sync them to a bpm that isn't the original bpm of one of the tracks?

Gapless playback between songs

Hello! I've been testing this library in an iOS application, and I have a question that I haven't seen answered here yet.

In my use case, I need to switch between two songs on the file system gaplessly, so that one file plays straight into the next one. I want to keep effects such as tempo etc. so that the user can't immediately distinguish where one song ends and the next begins. As far as I can see in the docs, there is no dedicated API that would do this for me right now.

I've tried creating two SuperpoweredAdvancedAudioPlayers and playing one of them after the other, which produces a noticeable gap. I guess I could try to cross-fade between them during the last second or so, but if at all possible I'd prefer for them to just flow into each other with no overlap.

Any suggestions for solving this would be very much appreciated!

Passing in a null audiobuffer input into SuperPowered3BandEQ causes a crash

Superpowered Version: 0.8
iOS Version: 8.3
iPhone Version: iPhone 6

Hey guys,

I currently maintain a collection of SuperpoweredFX objects within a vector to streamline effects chain processing within the audio callback. My chain currently contains an EQ, Echo, and Reverb objects. I process all of these within a loop in the audio callback like so:

for (auto& effect : effects) { 
   isAudioGenerated = effect->process(isAudioGenerated ? stereoBuffer : NULL, 
stereoBuffer, numberOfSamples) || isAudioGenerated;
}

I use the ternary operator to pass in a null buffer if no audio was generated by the player because the echo and reverb effects do not render their tails properly otherwise, as is noted within their documentation.

However, adding an EQ to this chain does not work, because passing in a null pointer for the buffer results in a bad memory access that crashes the program. This forces me to call the EQ's process() method with different arguments than the rest of my effects, which really kills the usefulness of having an abstract SuperpoweredFX interface.

Could you update the Superpowered3BandEQ's process() method to handle a null audio buffer input gracefully, so its interface matches that of the other effects?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.