Actualización a nuestro Platinum servicio y obtener su propio diseño personalizado en 3D de avatar
Bot Libre Forum : Have any support for text to speech on Java/Android library?

RE: Have any support for text to speech on Java/Android library?

por admin publicado Apr 27 2016, 6:57

All of the SDKs use the same web API, so if the SDK is missing something you can just call the web API directly.

We will be updating the Android and Java SDKs soon to support more of the web API.

For now you can call the web API directly through your SDKConnection class. POST is protected correctly, so you can subclass SDKConnection with your own subclass to add a method.

1
2
3
4
5
6
public String tts(Speech config) {
  config.addCredentials(this);
  return POST(this.url + "/speak"config.toXML());
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Where Speech is,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Speech extends Config {
    public String text;
    public String voice;
    
    public String toXML() {
        StringWriter writer = new StringWriter();
        writer.write("<speech");
        writeCredentials(writer);
        if (this.text != null) {
            writer.write(" text=\"" + this.text + "\"");
        }
        if (this.voice != null) {
            writer.write(" voice=\"" + this.voice + "\"");
        }
        writer.write("/>");
        return writer.toString();
    }
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Id: 12634549
Etiquetas: sdk
Publicado: Apr 27 2016, 6:57
Actualizado: Apr 27 2016, 6:59
Respuestas: 0
Vistas: 4516, hoy: 2, la semana: 10, mes: 9
0 0 0.0/5