@@ -195,9 +195,9 @@ short* createResampledBuf(uint32_t idx, uint32_t srcRate, unsigned* size) {
195195}
196196
197197// this callback handler is called every time a buffer finishes playing
198- void bqPlayerCallback (SLAndroidSimpleBufferQueueItf bq, void * context) {
198+ void bqPlayerCallback ([[maybe_unused]] SLAndroidSimpleBufferQueueItf bq,
199+ void *) {
199200 assert (bq == bqPlayerBufferQueue);
200- assert (NULL == context);
201201 // for streaming playback, replace this test by logic to find and fill the
202202 // next buffer
203203 if (--nextCount > 0 && NULL != nextBuffer && 0 != nextSize) {
@@ -218,9 +218,9 @@ void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context) {
218218}
219219
220220// this callback handler is called every time a buffer finishes recording
221- void bqRecorderCallback (SLAndroidSimpleBufferQueueItf bq, void * context) {
221+ void bqRecorderCallback ([[maybe_unused]] SLAndroidSimpleBufferQueueItf bq,
222+ void *) {
222223 assert (bq == recorderBufferQueue);
223- assert (NULL == context);
224224 // for streaming recording, here we would call Enqueue to give recorder the
225225 // next buffer to fill but instead, this is a one-time buffer so we stop
226226 // recording
@@ -235,8 +235,7 @@ void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void* context) {
235235
236236// create the engine and output mix objects
237237extern " C" JNIEXPORT void JNICALL
238- Java_com_example_nativeaudio_NativeAudio_createEngine (JNIEnv* env,
239- jclass clazz) {
238+ Java_com_example_nativeaudio_NativeAudio_createEngine (JNIEnv*, jclass) {
240239 SLresult result;
241240
242241 // create engine
@@ -289,7 +288,7 @@ Java_com_example_nativeaudio_NativeAudio_createEngine(JNIEnv* env,
289288// create buffer queue audio player
290289extern " C" JNIEXPORT void JNICALL
291290Java_com_example_nativeaudio_NativeAudio_createBufferQueueAudioPlayer (
292- JNIEnv* env , jclass clazz , jint sampleRate, jint bufSize) {
291+ JNIEnv*, jclass, jint sampleRate, jint bufSize) {
293292 SLresult result;
294293 if (sampleRate >= 0 && bufSize >= 0 ) {
295294 bqPlayerSampleRate = sampleRate * 1000 ;
@@ -398,7 +397,7 @@ Java_com_example_nativeaudio_NativeAudio_createBufferQueueAudioPlayer(
398397// create URI audio player
399398extern " C" JNIEXPORT jboolean JNICALL
400399Java_com_example_nativeaudio_NativeAudio_createUriAudioPlayer (JNIEnv* env,
401- jclass clazz ,
400+ jclass,
402401 jstring uri) {
403402 SLresult result;
404403
@@ -474,7 +473,7 @@ Java_com_example_nativeaudio_NativeAudio_createUriAudioPlayer(JNIEnv* env,
474473// to PLAYING (true) or PAUSED (false)
475474extern " C" JNIEXPORT void JNICALL
476475Java_com_example_nativeaudio_NativeAudio_setPlayingUriAudioPlayer (
477- JNIEnv* env , jclass clazz , jboolean isPlaying) {
476+ JNIEnv*, jclass, jboolean isPlaying) {
478477 SLresult result;
479478
480479 // make sure the URI audio player was created
@@ -491,7 +490,7 @@ Java_com_example_nativeaudio_NativeAudio_setPlayingUriAudioPlayer(
491490// set the whole file looping state for the URI audio player
492491extern " C" JNIEXPORT void JNICALL
493492Java_com_example_nativeaudio_NativeAudio_setLoopingUriAudioPlayer (
494- JNIEnv* env , jclass clazz , jboolean isLooping) {
493+ JNIEnv*, jclass, jboolean isLooping) {
495494 SLresult result;
496495
497496 // make sure the URI audio player was created
@@ -518,7 +517,7 @@ static SLMuteSoloItf getMuteSolo() {
518517
519518extern " C" JNIEXPORT void JNICALL
520519Java_com_example_nativeaudio_NativeAudio_setChannelMuteUriAudioPlayer (
521- JNIEnv* env , jclass clazz , jint chan, jboolean mute) {
520+ JNIEnv*, jclass, jint chan, jboolean mute) {
522521 SLresult result;
523522 SLMuteSoloItf muteSoloItf = getMuteSolo ();
524523 if (NULL != muteSoloItf) {
@@ -530,7 +529,7 @@ Java_com_example_nativeaudio_NativeAudio_setChannelMuteUriAudioPlayer(
530529
531530extern " C" JNIEXPORT void JNICALL
532531Java_com_example_nativeaudio_NativeAudio_setChannelSoloUriAudioPlayer (
533- JNIEnv* env , jclass clazz , jint chan, jboolean solo) {
532+ JNIEnv*, jclass, jint chan, jboolean solo) {
534533 SLresult result;
535534 SLMuteSoloItf muteSoloItf = getMuteSolo ();
536535 if (NULL != muteSoloItf) {
@@ -541,8 +540,8 @@ Java_com_example_nativeaudio_NativeAudio_setChannelSoloUriAudioPlayer(
541540}
542541
543542extern " C" JNIEXPORT jint JNICALL
544- Java_com_example_nativeaudio_NativeAudio_getNumChannelsUriAudioPlayer (
545- JNIEnv* env, jclass clazz ) {
543+ Java_com_example_nativeaudio_NativeAudio_getNumChannelsUriAudioPlayer (JNIEnv*,
544+ jclass ) {
546545 SLuint8 numChannels;
547546 SLresult result;
548547 SLMuteSoloItf muteSoloItf = getMuteSolo ();
@@ -573,7 +572,7 @@ static SLVolumeItf getVolume() {
573572
574573extern " C" JNIEXPORT void JNICALL
575574Java_com_example_nativeaudio_NativeAudio_setVolumeUriAudioPlayer (
576- JNIEnv* env , jclass clazz , jint millibel) {
575+ JNIEnv*, jclass, jint millibel) {
577576 SLresult result;
578577 SLVolumeItf volumeItf = getVolume ();
579578 if (NULL != volumeItf) {
@@ -584,8 +583,7 @@ Java_com_example_nativeaudio_NativeAudio_setVolumeUriAudioPlayer(
584583}
585584
586585extern " C" JNIEXPORT void JNICALL
587- Java_com_example_nativeaudio_NativeAudio_setMuteUriAudioPlayer (JNIEnv* env,
588- jclass clazz,
586+ Java_com_example_nativeaudio_NativeAudio_setMuteUriAudioPlayer (JNIEnv*, jclass,
589587 jboolean mute) {
590588 SLresult result;
591589 SLVolumeItf volumeItf = getVolume ();
@@ -598,7 +596,7 @@ Java_com_example_nativeaudio_NativeAudio_setMuteUriAudioPlayer(JNIEnv* env,
598596
599597extern " C" JNIEXPORT void JNICALL
600598Java_com_example_nativeaudio_NativeAudio_enableStereoPositionUriAudioPlayer (
601- JNIEnv* env , jclass clazz , jboolean enable) {
599+ JNIEnv*, jclass, jboolean enable) {
602600 SLresult result;
603601 SLVolumeItf volumeItf = getVolume ();
604602 if (NULL != volumeItf) {
@@ -610,7 +608,7 @@ Java_com_example_nativeaudio_NativeAudio_enableStereoPositionUriAudioPlayer(
610608
611609extern " C" JNIEXPORT void JNICALL
612610Java_com_example_nativeaudio_NativeAudio_setStereoPositionUriAudioPlayer (
613- JNIEnv* env , jclass clazz , jint permille) {
611+ JNIEnv*, jclass, jint permille) {
614612 SLresult result;
615613 SLVolumeItf volumeItf = getVolume ();
616614 if (NULL != volumeItf) {
@@ -622,7 +620,7 @@ Java_com_example_nativeaudio_NativeAudio_setStereoPositionUriAudioPlayer(
622620
623621// enable reverb on the buffer queue player
624622extern " C" JNIEXPORT jboolean JNICALL
625- Java_com_example_nativeaudio_NativeAudio_enableReverb (JNIEnv* env , jclass clazz ,
623+ Java_com_example_nativeaudio_NativeAudio_enableReverb (JNIEnv*, jclass,
626624 jboolean enabled) {
627625 SLresult result;
628626
@@ -652,8 +650,8 @@ Java_com_example_nativeaudio_NativeAudio_enableReverb(JNIEnv* env, jclass clazz,
652650
653651// select the desired clip and play count, and enqueue the first buffer if idle
654652extern " C" JNIEXPORT jboolean JNICALL
655- Java_com_example_nativeaudio_NativeAudio_selectClip (JNIEnv* env , jclass clazz ,
656- jint which, jint count) {
653+ Java_com_example_nativeaudio_NativeAudio_selectClip (JNIEnv*, jclass, jint which ,
654+ jint count) {
657655 if (pthread_mutex_trylock (&audioEngineLock)) {
658656 // If we could not acquire audio engine lock, reject this request and client
659657 // should re-try
@@ -726,7 +724,7 @@ Java_com_example_nativeaudio_NativeAudio_selectClip(JNIEnv* env, jclass clazz,
726724// create asset audio player
727725extern " C" JNIEXPORT jboolean JNICALL
728726Java_com_example_nativeaudio_NativeAudio_createAssetAudioPlayer (
729- JNIEnv* env, jclass clazz , jobject assetManager, jstring filename) {
727+ JNIEnv* env, jclass, jobject assetManager, jstring filename) {
730728 SLresult result;
731729
732730 // convert Java string to UTF-8
@@ -815,7 +813,7 @@ Java_com_example_nativeaudio_NativeAudio_createAssetAudioPlayer(
815813// set the playing state for the asset audio player
816814extern " C" JNIEXPORT void JNICALL
817815Java_com_example_nativeaudio_NativeAudio_setPlayingAssetAudioPlayer (
818- JNIEnv* env , jclass clazz , jboolean isPlaying) {
816+ JNIEnv*, jclass, jboolean isPlaying) {
819817 SLresult result;
820818
821819 // make sure the asset audio player was created
@@ -833,8 +831,7 @@ Java_com_example_nativeaudio_NativeAudio_setPlayingAssetAudioPlayer(
833831// like to avoid excessive re-sampling while playing back from Hello &
834832// Android clip
835833extern " C" JNIEXPORT jboolean JNICALL
836- Java_com_example_nativeaudio_NativeAudio_createAudioRecorder (JNIEnv* env,
837- jclass clazz) {
834+ Java_com_example_nativeaudio_NativeAudio_createAudioRecorder (JNIEnv*, jclass) {
838835 SLresult result;
839836
840837 // configure audio source
@@ -895,8 +892,7 @@ Java_com_example_nativeaudio_NativeAudio_createAudioRecorder(JNIEnv* env,
895892
896893// set the recording state for the audio recorder
897894extern " C" JNIEXPORT void JNICALL
898- Java_com_example_nativeaudio_NativeAudio_startRecording (JNIEnv* env,
899- jclass clazz) {
895+ Java_com_example_nativeaudio_NativeAudio_startRecording (JNIEnv*, jclass) {
900896 SLresult result;
901897
902898 if (pthread_mutex_trylock (&audioEngineLock)) {
@@ -934,7 +930,7 @@ Java_com_example_nativeaudio_NativeAudio_startRecording(JNIEnv* env,
934930
935931// shut down the native audio system
936932extern " C" JNIEXPORT void JNICALL
937- Java_com_example_nativeaudio_NativeAudio_shutdown (JNIEnv* env , jclass clazz ) {
933+ Java_com_example_nativeaudio_NativeAudio_shutdown (JNIEnv*, jclass) {
938934 // destroy buffer queue audio player object, and invalidate all associated
939935 // interfaces
940936 if (bqPlayerObject != NULL ) {
0 commit comments