尝试播放以下主题文件:
topic: ~test()
language: en
# Defining extra concepts out of words or group of words
concept:(hello) [hi hey]
# Replying to speech
u:(~hello) ~hello
QiChatPlayer 初始化:
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import com.aldebaran.apps.qichatplayer.QiChatPlayer;
import com.aldebaran.apps.qichatplayer.QiChatPlayerListener;
public class MainActivity extends Activity {
private static final String TAG = MainActivity.class.getSimpleName();
QiChatPlayer qiChatPlayer = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
protected void onResume() {
super.onResume();
qiChatPlayer = new QiChatPlayer(getApplicationContext());
qiChatPlayer.changeLogSetting(true, true, true, true, true, true);
qiChatPlayer.init(new QiChatPlayerListener() {
@Override
public void onQiChatPlayerServiceConnected() {
qiChatPlayer.loadTopicFile("test");
}
@Override
public void onLoadCompleted() {
qiChatPlayer.startTalk();
}
@Override
public void onError(int i) {
Log.e(TAG, "error: " + i);
}
});
}
@Override
protected void onPause() {
super.onPause();
qiChatPlayer.stopTalk();
}
@Override
protected void onDestroy() {
super.onDestroy();
qiChatPlayer.destroy();
}
}
在 QiChatPlayer faze 中得到以下内容:
com.aldebaran.apps.ttsengine W/qimessaging.jni: FIXME: only jstring are supported
com.aldebaran.apps.ttsengine W/qimessaging.jni: FIXME: only jstring are supported
com.aldebaran.apps.ttsengine E/qi.path.sdklayout: Cannot create directory '"/mnt/sdcard/.config/qimessaging"' error was: boost::filesystem::status: Permission denied: "/mnt/sdcard/.config/qimessaging"
com.aldebaran.apps.ttsengine E/qi.os: Unable to create file: ''
com.aldebaran.apps.ttsengine W/qimessaging.transportsocket: connect: Connection refused
试图与机器人交谈:
human: hi
robot: hello
预期的机器人答案是“hi”或“hey”,但他的答案不是这个,而是概念名称。
好的。让我们尝试简化主题:
topic: ~test()
language: en
u:(Hi) Hello
human: Hi
robot: Hello
它有效,但错误/警告是相同的。另一个尝试:
topic: ~test()
language: en
u:(Hi) Hello human
human: Hi
robot Hellohuman
多一个:
topic: ~test()
language: enu
u:([Hi hello]) [hello hi] human
对话:
human: Hi
robot: hellohihuman
在这种情况下:
topic: ~test()
language: enu
u:(["hello how are you" "hello are you OK"]) ["I am fine" "I am OK"]
应用程序崩溃:
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 25774 (Thread-263)
com.aldebaran.robotservice I/RobotService: Send broadcast for Activity : robolutions.com.robotapp.MainActivity
I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG: Build fingerprint: 'Android/aosp_x86/generic_x86:5.1.1/LMY49F/pepper05170905:userdebug/release-keys'
I/DEBUG: Revision: '0'
I/DEBUG: ABI: 'x86'
I/DEBUG: pid: 25758, tid: 25774, name: Thread-263 >>> robolutions.com.robotapp <<<
I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
I/DEBUG: eax a4f54a14 ebx b318df58 ecx 00000000 edx 00000000
I/DEBUG: esi 00000000 edi a40180b8
I/DEBUG: xcs 00000073 xds 0000007b xes 0000007b xfs 0000005f xss 0000007b
I/DEBUG: eip b3182c7a ebp a40180a0 esp a4f547f0 flags 00210246
I/DEBUG: backtrace:
I/DEBUG: #00 pc 00007c7a /data/app/robolutions.com.robotapp-1/lib/x86/libqichat.so (yyparse+4058)
I/DEBUG: #01 pc 000059d7 /data/app/robolutions.com.robotapp-1/lib/x86/libqichat.so (parse+167)
I/DEBUG: #02 pc 00002819 /data/app/robolutions.com.robotapp-1/lib/x86/libqichat.so
I/DEBUG: #03 pc 000094ca /data/dalvik-cache/x86/data@app@robolutions.com.robotapp-1@base.apk@classes.dex
我试图找到可以满足我要求的工作示例,但我发现的只是简单的示例,比如 hi-hello 在我的情况下也可以工作。
对于主题创建,我遵循了本指南:对话框编辑器
毕业典礼:
compile 'com.aldebaran:libqi-java-android:sdk-2016-05-16'
compile 'com.aldebaran:qisdk:0.7'
compile 'com.aldebaran:qichatplayer:1.0.1'
使用的sdk和工具: