I am using IBM bluemix to transcribe some audio, and I want to use the APIs speaker recognition.
I set up the the recognizer like this:
private RecognizeOptions getRecognizeOptions() {
return new RecognizeOptions.Builder()
.continuous(true)
.contentType(ContentType.OPUS.toString())
//.model("en-US")
.model("en-US_BroadbandModel")
.timestamps(true)
.smartFormatting(true)
.interimResults(true)
.speakerLabels(true)
.build();
}
But the returned JSON doesnt include the speaker tag. How can I get the speaker tag also returned with the bluemix java API?
My audio recorder in Android looks like this:
private void recordMessage() {
//mic.setEnabled(false);
speechService = new SpeechToText();
speechService.setUsernameAndPassword("usr", "pwd");
if(listening != true) {
capture = new MicrophoneInputStream(true);
new Thread(new Runnable() {
@Override public void run() {
try {
speechService.recognizeUsingWebSocket(capture, getRecognizeOptions(), new MicrophoneRecognizeDelegate());
} catch (Exception e) {
showError(e);
}
}
}).start();
Log.v("TAG",getRecognizeOptions().toString());
listening = true;
Toast.makeText(MainActivity.this,"Listening....Click to Stop", Toast.LENGTH_LONG).show();
} else {
try {
capture.close();
listening = false;
Toast.makeText(MainActivity.this,"Stopped Listening....Click to Start", Toast.LENGTH_LONG).show();
} catch (Exception e) {
e.printStackTrace();
}
}
}