Loading core/jni/android_media_AudioTrack.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -887,17 +887,22 @@ static jint android_media_AudioTrack_get_min_buff_size(JNIEnv *env, jobject thi } // ---------------------------------------------------------------------------- static void static jint android_media_AudioTrack_setAuxEffectSendLevel(JNIEnv *env, jobject thiz, jfloat level ) { sp<AudioTrack> lpTrack = getAudioTrack(env, thiz); if (lpTrack == NULL ) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve AudioTrack pointer for setAuxEffectSendLevel()"); return; return -1; } lpTrack->setAuxEffectSendLevel(level); status_t status = lpTrack->setAuxEffectSendLevel(level); if (status != NO_ERROR) { ALOGE("AudioTrack::setAuxEffectSendLevel() for level %g failed with status %d", level, status); } return (jint) status; } // ---------------------------------------------------------------------------- Loading Loading @@ -953,7 +958,7 @@ static JNINativeMethod gMethods[] = { {"native_get_min_buff_size", "(III)I", (void *)android_media_AudioTrack_get_min_buff_size}, {"native_setAuxEffectSendLevel", "(F)V", (void *)android_media_AudioTrack_setAuxEffectSendLevel}, "(F)I", (void *)android_media_AudioTrack_setAuxEffectSendLevel}, {"native_attachAuxEffect", "(I)I", (void *)android_media_AudioTrack_attachAuxEffect}, }; Loading media/java/android/media/AudioTrack.java +4 −4 Original line number Diff line number Diff line Loading @@ -1321,7 +1321,7 @@ public class AudioTrack * * @param level send level scalar * @return error code or success, see {@link #SUCCESS}, * {@link #ERROR_INVALID_OPERATION} * {@link #ERROR_INVALID_OPERATION}, {@link #ERROR} */ public int setAuxEffectSendLevel(float level) { if (isRestricted()) { Loading @@ -1337,8 +1337,8 @@ public class AudioTrack if (level > getMaxVolume()) { level = getMaxVolume(); } native_setAuxEffectSendLevel(level); return SUCCESS; int err = native_setAuxEffectSendLevel(level); return err == 0 ? SUCCESS : ERROR; } //--------------------------------------------------------- Loading Loading @@ -1508,7 +1508,7 @@ public class AudioTrack int sampleRateInHz, int channelConfig, int audioFormat); private native final int native_attachAuxEffect(int effectId); private native final void native_setAuxEffectSendLevel(float level); private native final int native_setAuxEffectSendLevel(float level); //--------------------------------------------------------- // Utility methods Loading Loading
core/jni/android_media_AudioTrack.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -887,17 +887,22 @@ static jint android_media_AudioTrack_get_min_buff_size(JNIEnv *env, jobject thi } // ---------------------------------------------------------------------------- static void static jint android_media_AudioTrack_setAuxEffectSendLevel(JNIEnv *env, jobject thiz, jfloat level ) { sp<AudioTrack> lpTrack = getAudioTrack(env, thiz); if (lpTrack == NULL ) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve AudioTrack pointer for setAuxEffectSendLevel()"); return; return -1; } lpTrack->setAuxEffectSendLevel(level); status_t status = lpTrack->setAuxEffectSendLevel(level); if (status != NO_ERROR) { ALOGE("AudioTrack::setAuxEffectSendLevel() for level %g failed with status %d", level, status); } return (jint) status; } // ---------------------------------------------------------------------------- Loading Loading @@ -953,7 +958,7 @@ static JNINativeMethod gMethods[] = { {"native_get_min_buff_size", "(III)I", (void *)android_media_AudioTrack_get_min_buff_size}, {"native_setAuxEffectSendLevel", "(F)V", (void *)android_media_AudioTrack_setAuxEffectSendLevel}, "(F)I", (void *)android_media_AudioTrack_setAuxEffectSendLevel}, {"native_attachAuxEffect", "(I)I", (void *)android_media_AudioTrack_attachAuxEffect}, }; Loading
media/java/android/media/AudioTrack.java +4 −4 Original line number Diff line number Diff line Loading @@ -1321,7 +1321,7 @@ public class AudioTrack * * @param level send level scalar * @return error code or success, see {@link #SUCCESS}, * {@link #ERROR_INVALID_OPERATION} * {@link #ERROR_INVALID_OPERATION}, {@link #ERROR} */ public int setAuxEffectSendLevel(float level) { if (isRestricted()) { Loading @@ -1337,8 +1337,8 @@ public class AudioTrack if (level > getMaxVolume()) { level = getMaxVolume(); } native_setAuxEffectSendLevel(level); return SUCCESS; int err = native_setAuxEffectSendLevel(level); return err == 0 ? SUCCESS : ERROR; } //--------------------------------------------------------- Loading Loading @@ -1508,7 +1508,7 @@ public class AudioTrack int sampleRateInHz, int channelConfig, int audioFormat); private native final int native_attachAuxEffect(int effectId); private native final void native_setAuxEffectSendLevel(float level); private native final int native_setAuxEffectSendLevel(float level); //--------------------------------------------------------- // Utility methods Loading