Skip to content

Commit

Permalink
Version 2.6.0
Browse files Browse the repository at this point in the history
- New AutomaticVocalPitchCorrection class implements the auto-tune effect. Adjustable scale (which notes are valid), range (wide/bass/tenor/alto/soprano), speed and middle frequency. Can be used from subtle vocal pitch correction to the strong popular auto-tune sound.
- "Offline mode" for AdvancedAudioPlayer. Set internalBufferSizeSeconds to 0 in the constructor to enable "offline mode", where the player can not be used for real-time playback, but can process audio in an iteration.
- Android minimum version was increased to API Level 24 (Android 7, 2016).
- Updated example projects to the recent versions of Android Studio, Xcode and Visual Studio.
  • Loading branch information
gaborszanto committed Aug 30, 2022
1 parent 0bbd8a4 commit c4c3daf
Show file tree
Hide file tree
Showing 136 changed files with 207 additions and 292 deletions.
12 changes: 6 additions & 6 deletions Examples_Android/SuperpoweredCrossExample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'com.android.application'
def superpowered_sdk_path = new File(projectDir, '../../../Superpowered')

android { // main settings for your application
compileSdkVersion = 31
compileSdkVersion = 33

defaultConfig {
applicationId "com.superpowered.crossexample"
minSdkVersion 22
targetSdkVersion 31
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -18,7 +18,7 @@ android { // main settings for your application

externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-22', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
arguments '-DANDROID_PLATFORM=android-24', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed
cppFlags '-fsigned-char', "-I${superpowered_sdk_path}"
}
Expand All @@ -31,10 +31,10 @@ android { // main settings for your application
}
}

ndkPath "/Volumes/iMect/android/ndk/23.1.7779620/android-ndk-r23b"
ndkPath "/Volumes/iMect/android/ndk/25.1.8937393"
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.appcompat:appcompat:1.5.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -209,29 +209,29 @@ Java_com_superpowered_crossexample_MainActivity_CrossExample(
// onPlayPause - Toggle playback state of player.
extern "C" JNIEXPORT void
Java_com_superpowered_crossexample_MainActivity_onPlayPause(JNIEnv * __unused env, jobject __unused obj, jboolean play) {
example->onPlayPause(play);
if (example) example->onPlayPause(play);
}

// onCrossfader - Handle crossfader events.
extern "C" JNIEXPORT void
Java_com_superpowered_crossexample_MainActivity_onCrossfader(JNIEnv * __unused env, jobject __unused obj, jint value) {
example->onCrossfader(value);
if (example) example->onCrossfader(value);
}

// onFxSelect - Handle FX selection.
extern "C" JNIEXPORT void
Java_com_superpowered_crossexample_MainActivity_onFxSelect(JNIEnv * __unused env, jobject __unused obj, jint value) {
example->onFxSelect(value);
if (example) example->onFxSelect(value);
}

// onFxOff - Turn of all effects.
extern "C" JNIEXPORT void
Java_com_superpowered_crossexample_MainActivity_onFxOff(JNIEnv * __unused env, jobject __unused obj) {
example->onFxOff();
if (example) example->onFxOff();
}

// onFxValue - Adjust FX value.
extern "C" JNIEXPORT void
Java_com_superpowered_crossexample_MainActivity_onFxValue(JNIEnv * __unused env, jobject __unused obj, jint value) {
example->onFxValue(value);
if (example) example->onFxValue(value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void CrossExample_PlayPause(View button) {
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
Expand Down
2 changes: 1 addition & 1 deletion Examples_Android/SuperpoweredCrossExample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.2.2'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
14 changes: 7 additions & 7 deletions Examples_Android/SuperpoweredEffect/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'com.android.application'
def superpowered_sdk_path = new File(projectDir, '../../../Superpowered')

android { // main settings for your application
compileSdkVersion = 31
compileSdkVersion = 33

defaultConfig {
applicationId "com.superpowered.effect"
minSdkVersion 22
targetSdkVersion 31
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -18,7 +18,7 @@ android { // main settings for your application

externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-22', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
arguments '-DANDROID_PLATFORM=android-24', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed
cppFlags '-fsigned-char', "-I${superpowered_sdk_path}"
}
Expand All @@ -31,11 +31,11 @@ android { // main settings for your application
}
}

ndkPath "/Volumes/iMect/android/ndk/23.1.7779620/android-ndk-r23b"
ndkPath "/Volumes/iMect/android/ndk/25.1.8937393"
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
// Called when the user answers to the permission dialogs.
if ((requestCode != 0) || (grantResults.length < 1) || (grantResults.length != permissions.length)) return;
boolean hasAllPermissions = true;
Expand Down
2 changes: 1 addition & 1 deletion Examples_Android/SuperpoweredEffect/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.2.2'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
12 changes: 6 additions & 6 deletions Examples_Android/SuperpoweredFrequencyDomain/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'com.android.application'
def superpowered_sdk_path = new File(projectDir, '../../../Superpowered')

android { // main settings for your application
compileSdkVersion = 31
compileSdkVersion = 33

defaultConfig {
applicationId "com.superpowered.frequencydomain"
minSdkVersion 22
targetSdkVersion 31
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -18,7 +18,7 @@ android { // main settings for your application

externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-22', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
arguments '-DANDROID_PLATFORM=android-24', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed
cppFlags '-fsigned-char', "-I${superpowered_sdk_path}"
}
Expand All @@ -31,10 +31,10 @@ android { // main settings for your application
}
}

ndkPath "/Volumes/iMect/android/ndk/23.1.7779620/android-ndk-r23b"
ndkPath "/Volumes/iMect/android/ndk/25.1.8937393"
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.appcompat:appcompat:1.5.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void initialize() {
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
Expand Down
2 changes: 1 addition & 1 deletion Examples_Android/SuperpoweredFrequencyDomain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.2.2'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
14 changes: 7 additions & 7 deletions Examples_Android/SuperpoweredPlayer/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'com.android.application'
def superpowered_sdk_path = new File(projectDir, '../../../Superpowered')

android { // main settings for your application
compileSdkVersion = 31
compileSdkVersion = 33

defaultConfig {
applicationId "com.superpowered.playerexample"
minSdkVersion 22
targetSdkVersion 31
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -18,7 +18,7 @@ android { // main settings for your application

externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-22', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
arguments '-DANDROID_PLATFORM=android-24', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed
cppFlags '-fsigned-char', "-I${superpowered_sdk_path}"
}
Expand All @@ -31,11 +31,11 @@ android { // main settings for your application
}
}

ndkPath "/Volumes/iMect/android/ndk/23.1.7779620/android-ndk-r23b"
ndkPath "/Volumes/iMect/android/ndk/25.1.8937393"
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
2 changes: 1 addition & 1 deletion Examples_Android/SuperpoweredPlayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.2.2'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
12 changes: 6 additions & 6 deletions Examples_Android/SuperpoweredRecorder/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'com.android.application'
def superpowered_sdk_path = new File(projectDir, '../../../Superpowered')

android { // main settings for your application
compileSdkVersion = 31
compileSdkVersion = 33

defaultConfig {
applicationId "com.superpowered.recorder"
minSdkVersion 22
targetSdkVersion 31
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -18,7 +18,7 @@ android { // main settings for your application

externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-22', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
arguments '-DANDROID_PLATFORM=android-24', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed
cppFlags '-fsigned-char', "-I${superpowered_sdk_path}"
}
Expand All @@ -36,6 +36,6 @@ android { // main settings for your application

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ static bool audioProcessing (
int numberOfFrames, // number of frames to process
int __unused samplerate // current sample rate in Hz
) {
{
static int test = 0;
test += numberOfFrames;
if (test >= 48000) {
test = 0;
__android_log_print(ANDROID_LOG_VERBOSE, "Superpowered", "record");
}
}
float floatBuffer[numberOfFrames * 2];
Superpowered::ShortIntToFloat(audio, floatBuffer, (unsigned int)numberOfFrames);
recorder->recordInterleaved(floatBuffer, (unsigned int)numberOfFrames);
Expand Down
2 changes: 1 addition & 1 deletion Examples_Android/SuperpoweredRecorder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.2.2'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
2 changes: 1 addition & 1 deletion Examples_Android/SuperpoweredUSBExample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.2.2'
}
}

Expand Down
12 changes: 6 additions & 6 deletions Examples_Android/SuperpoweredUSBExample/complexusb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'com.android.application'
def superpowered_sdk_path = new File(projectDir, '../../../Superpowered')

android { // main settings for your application
compileSdkVersion = 31
compileSdkVersion = 33

defaultConfig {
applicationId "com.superpowered.complexusb"
minSdkVersion 22 //more than 96.5% of all active Android devices
targetSdkVersion 31
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -18,7 +18,7 @@ android { // main settings for your application

externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-22', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
arguments '-DANDROID_PLATFORM=android-24', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_static', "-DPATH_TO_SUPERPOWERED:STRING=${superpowered_sdk_path}"
cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed
cppFlags '-fsigned-char', "-I${superpowered_sdk_path}"
}
Expand All @@ -31,10 +31,10 @@ android { // main settings for your application
}
}

ndkPath "/Volumes/iMect/android/ndk/23.1.7779620/android-ndk-r23b"
ndkPath "/Volumes/iMect/android/ndk/25.1.8937393"
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.appcompat:appcompat:1.5.0'
}
Loading

0 comments on commit c4c3daf

Please sign in to comment.