我signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)在我的应用程序中随机获得Native Crash .App循环遍历文件并在C++代码中分析它们并返回一个浮点数组.这是在AsyncTask中完成的,它在处理文件时运行一段时间.我在导致崩溃的代码中做错了什么?或者它是一个超级能源问题?谢谢.
这是AsyncTask doInBackground函数:
protected String doInBackground(Object... urls) {
for (int i = 0; i < songFiles.size(); i++) {
SongFile temp = songFiles.get(i);
try {
float[] f = Analyser.getInfo(temp.getPath());
if (f != null && f.length > 1) {
...save to DB
}
}
} catch (Exception e) {
}
}
return "";
}
Run Code Online (Sandbox Code Playgroud)
Java和C++代码之间的功能:
extern "C" JNIEXPORT jfloatArray Java_com_superpowered_SuperpoweredPlayer_getInfo(JNIEnv *env, jobject instance,jstring filepath) {
jfloatArray ret;
char *Path= (char *) env->GetStringUTFChars(filepath, JNI_FALSE); …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Superpowered SDK在正在播放和同时录制的mp3文件上应用实时Time Stretching和Pitch Shifting.问题在于,无论我做什么,输出音质都很糟糕(到了它被扭曲的程度).
我怀疑这是由于每帧数的样本冲突造成的.这是我的cpp文件的完整源代码:
static SuperpoweredAndroidAudioIO *audioIO;
static SuperpoweredTimeStretching *stretching;
static SuperpoweredAudiopointerList *outputBuffers;
static SuperpoweredDecoder *decoder;
static SuperpoweredRecorder *recorder;
const char *outFilePath;
const char *tempFilePath;
static short int *intBuffer;
static float *playerBuffer;
bool audioInitialized = false;
bool playing = false;
static bool audioProcessing(
void *__unused clientData, // custom pointer
short int *audio, // buffer of interleaved samples
int numberOfFrames, // number of frames to process
int __unused sampleRate // sampling rate
) {
if (playing) {
unsigned …Run Code Online (Sandbox Code Playgroud) 我已经成功集成了超级动力CrossExample,现在我需要应用静音左/右音频效果,我已经检查过了
SuperpoweredMixer.h , SuperpoweredSimple.h
Run Code Online (Sandbox Code Playgroud)
这些文件但无法找到应用此效果的相关方法,
有没有其他方法来做这件事?
我试图了解Superpowered SDK,但对于Android和C ++以及音频信号来说都是新功能。我从这里有频域示例:https : //github.com/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/tree/master/Examples_Android/FrequencyDomain
在我的Nexus 5X上运行。在FrequencyDomain.cpp文件中:
static SuperpoweredFrequencyDomain *frequencyDomain;
static float *magnitudeLeft, *magnitudeRight, *phaseLeft, *phaseRight, *fifoOutput, *inputBufferFloat;
static int fifoOutputFirstSample, fifoOutputLastSample, stepSize, fifoCapacity;
#define FFT_LOG_SIZE 11 // 2^11 = 2048
static bool audioProcessing(void * __unused clientdata, short int *audioInputOutput, int numberOfSamples, int __unused samplerate) {
SuperpoweredShortIntToFloat(audioInputOutput, inputBufferFloat, (unsigned int)numberOfSamples); // Converting the 16-bit integer samples to 32-bit floating point.
frequencyDomain->addInput(inputBufferFloat, numberOfSamples); // Input goes to the frequency domain.
// In the frequency domain we are working with 1024 …Run Code Online (Sandbox Code Playgroud) 我可以有关于如何在 Android Studio 上安装超级插件的分步教程/说明吗?我是移动开发者世界的新手,我不知道如何去做。非常感谢我的英语。
superpowered ×5
android ×4
c++ ×4
audio ×2
android-ndk ×1
configure ×1
installation ×1
java ×1