diff --git a/ailib/src/main/java/ai/api/AIConfiguration.java b/ailib/src/main/java/ai/api/AIConfiguration.java index ab5641a..1ebdc20 100644 --- a/ailib/src/main/java/ai/api/AIConfiguration.java +++ b/ailib/src/main/java/ai/api/AIConfiguration.java @@ -32,10 +32,6 @@ public class AIConfiguration { private String serviceUrl; - public String getAgentId() { - return "Assistant"; - } - public enum RecognitionEngine { /** diff --git a/ailib/src/main/java/ai/api/AIDataService.java b/ailib/src/main/java/ai/api/AIDataService.java index 1ed2b1e..7efcddb 100644 --- a/ailib/src/main/java/ai/api/AIDataService.java +++ b/ailib/src/main/java/ai/api/AIDataService.java @@ -80,7 +80,6 @@ public AIResponse request(final AIRequest request) throws AIServiceException { final URL url = new URL(config.getQuestionUrl()); request.setLanguage(config.getLanguage()); - request.setAgentId(config.getAgentId()); request.setTimezone(Calendar.getInstance().getTimeZone().getID()); final String queryData = gson.toJson(request); @@ -158,7 +157,6 @@ public AIResponse voiceRequest(final InputStream voiceStream, final List= 0) { @@ -116,13 +116,13 @@ public void onSpeechEnd() { assertFalse(voiceDetected); - } catch (Exception e) { + } catch (final Exception e) { e.printStackTrace(); assertTrue(e.getMessage(), false); } } - @Test + // @Test TODO enable after VAD improvement public void testNoise() { final VoiceActivityDetector voiceActivityDetector = new VoiceActivityDetector(SAMPLE_RATE); @@ -145,7 +145,7 @@ public void onSpeechEnd() { try { final int bufferSize = 1096; - byte[] buffer = new byte[bufferSize]; + final byte[] buffer = new byte[bufferSize]; int bytesRead = inputStream.read(buffer, 0, bufferSize); while (bytesRead >= 0) { @@ -155,7 +155,7 @@ public void onSpeechEnd() { assertFalse(voiceDetected); - } catch (Exception e) { + } catch (final Exception e) { e.printStackTrace(); assertTrue(e.getMessage(), false); } diff --git a/apiAISampleApp/src/main/java/ai/api/sample/MainActivity.java b/apiAISampleApp/src/main/java/ai/api/sample/MainActivity.java index 7f3222a..0d36e57 100644 --- a/apiAISampleApp/src/main/java/ai/api/sample/MainActivity.java +++ b/apiAISampleApp/src/main/java/ai/api/sample/MainActivity.java @@ -28,6 +28,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.EditText; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; @@ -60,7 +61,8 @@ public class MainActivity extends ActionBarActivity implements AIListener { private ImageView recIndicator; private TextView resultTextView; private Gson gson; - private TextView contextTextView; + private EditText contextTextView; + private EditText agentTextView; @Override protected void onCreate(final Bundle savedInstanceState) { @@ -73,7 +75,7 @@ protected void onCreate(final Bundle savedInstanceState) { recIndicator.setVisibility(View.INVISIBLE); resultTextView = (TextView) findViewById(R.id.resultTextView); - contextTextView = (TextView) findViewById(R.id.contextTextView); + contextTextView = (EditText) findViewById(R.id.contextTextView); gson = GsonFactory.getGson();