following steps in here android sdk developer's guide navigation voice instruction, cannot start voice feature. debug information below:
// retrieve voicecatalog , download latest updates voicecatalog voicecatalog = voicecatalog.getinstance(); voicecatalog.downloadcatalog(new voicecatalog.ondownloaddonelistener() { @override public void ondownloaddone(voicecatalog.error error) { if (error == voicecatalog.error.none) { // catalog download successful toast.maketext(getapplicationcontext(), "voice catalog download successful.", toast.length_long).show(); } else { toast.maketext(getapplicationcontext(), "voice catalog download error.", toast.length_long).show(); } } });
ondownloaddone() function receive error: voicecatalog.error unknow
voicecatalog.getinstance().islocalcatalogavailable()
islocalcatalogavailable() false.
- a set of sample voice skins sdk.zip/misc copied /data/app_namespace/files/voices-download
could suggest on issue? thanks.
we find following solution issue.
private void setupvoice() { // retrieve voicecatalog , download latest updates voicecatalog voicecatalog = voicecatalog.getinstance(); if (!voicecatalog.islocalcatalogavailable()) { if (debug) log.d(tag, "voice catalog not available in local storage."); //toast.maketext(mactivity.getapplicationcontext(), "voice catalog not available in local storage.", toast.length_long).show(); voicecatalog.downloadcatalog(new voicecatalog.ondownloaddonelistener() { @override public void ondownloaddone(voicecatalog.error error) { if (error == voicecatalog.error.none) { // catalog download successful if (debug) log.d(tag, "download voice catalog successfully."); //toast.maketext(mactivity.getapplicationcontext(), "voice catalog download successful.", toast.length_long).show(); } else { if (debug) log.d(tag, "download voice catalog failed."); //toast.maketext(mactivity.getapplicationcontext(), "voice catalog download error.", toast.length_long).show(); } // list of voice packages voice catalog list list<voicepackage> voicepackages = voicecatalog.getinstance().getcataloglist(); if (voicepackages.size() == 0) { if (debug) log.d(tag, "voice catalog size 0."); //toast.maketext(mactivity.getapplicationcontext(), "voice catalog size 0.", toast.length_long).show(); } long id = -1; // select (voicepackage voicepackage : voicepackages) { if (voicepackage.getmarccode().comparetoignorecase("eng") == 0) { //if (voicepackage.istts()) // todo: need figure out why return false { id = voicepackage.getid(); break; } } } if (!voicecatalog.getinstance().islocalvoiceskin(id)) { final long finalid = id; voicecatalog.getinstance().downloadvoice(id, new voicecatalog.ondownloaddonelistener() { @override public void ondownloaddone(voicecatalog.error error) { if (error == voicecatalog.error.none) { //voice skin download successful if (debug) log.d(tag, "download voice skin successfully."); //toast.maketext(mactivity.getapplicationcontext(), "voice skin download successful.", toast.length_long).show(); // set voice skin use navigation manager if (voicecatalog.getinstance().getlocalvoiceskin(finalid) != null) { m_navigationmanager.setvoiceskin(voicecatalog.getinstance().getlocalvoiceskin(finalid)); } else { if (debug) log.d(tag, "get local voice skin error."); //toast.maketext(mactivity.getapplicationcontext(), "navi manager set voice skin error.", toast.length_long).show(); } } else { if (debug) log.d(tag, "download voice skin failed."); //toast.maketext(mactivity.getapplicationcontext(), "voice skin download error.", toast.length_long).show(); } } }); } else { // set voice skin use navigation manager if (voicecatalog.getinstance().getlocalvoiceskin(id) != null) { m_navigationmanager.setvoiceskin(voicecatalog.getinstance().getlocalvoiceskin(id)); } else { if (debug) log.d(tag, "get local voice skin error."); //toast.maketext(mactivity.getapplicationcontext(), "navi manager set voice skin error.", toast.length_long).show(); } } } }); } }
Comments
Post a Comment