简体   繁体   中英

HERE Android SDK AudioPlayerDelegate does not work

I created a AudioPlayerDelegate to play navigation text via my audio player, but the function playText() never get called during navigation, while another function playFiles() get called.

Below is the code snippet:

private class MyAudioPlayerDelegate implements AudioPlayerDelegate {

        @Override
        public boolean playText(String s) {

            TTSController.getInstance(HEREMapActivity.this).playText(s);
            return true;
        }

        @Override
        public boolean playFiles(String[] strings) {
            Log.d("voice", strings.toString());
            return true;
        }
    }


  if (myAudioPlayerDelegate == null) {
            myAudioPlayerDelegate = new MyAudioPlayerDelegate();
   }
        navigationManager.getAudioPlayer().setDelegate(myAudioPlayerDelegate);

Seems you are not using a TTS enabled voice skin. Only TTS skins will callback to the playText() method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM