-
MainActivity.java
@Override public boolean onTouch(View view, MotionEvent motionEvent) { switch (motionEvent.getAction()){ case MotionEvent.ACTION_MOVE: break; case MotionEvent.ACTION_UP: break; case MotionEvent.ACTION_DOWN: if (mEngineHandle != INVALID_PTR) { nativeAAudioEngineStop(mEngineHandle); nativeDestroyAAudioEngine(mEngineHandle); mEngineHandle = INVALID_PTR; } if (mEngineHandle == INVALID_PTR) { mEngineHandle = nativeCreateAAudioEngine(getAssets(), TEST_FILE_PATH, AUDIO_SAMPLERATE, AUDIO_CHANNELS, AUDIO_FORMAT); } if (mEngineHandle != INVALID_PTR) { nativeAAudioEnginePlay(mEngineHandle); } break; default:break; } return true; } });
-
Project build.gradle
dependencies { classpath "com.android.tools.build:gradle:7.0.2" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }
-
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
-
将wav转换为48kHz单声道pcm
ffmpeg -y -i test.wav -acodec pcm_s16le -f s16le -ac 1 -ar 48000 test.pcm
-
将wav转换为48kHz双声道pcm
ffmpeg -y -i test.wav -acodec pcm_s16le -f s16le -ac 2 -ar 48000 test.pcm
- Android Studio Giraffe | 2022.3.1 Patch 2
- 环境变量中将ANDROID_SDK_HOME改为ANDROID_HOME
-
local.properties修改如下:
sdk.dir=C\:\\Users\\xxxx\\AppData\\Local\\Android\\Sdk ndk.dir=C\:\\Users\\xxxx\\AppData\\Local\\Android\\Sdk\\ndk\\21.4.7075529