MainActivity.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:samples-cognitive-services-android 作者:
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    SpeechConfiguration configuration = new SpeechConfiguration(SUBSCRIPTION_KEY, EndPoint.Conversation, OutputFormat.SIMPLE);
    speechClient = SpeechToText.getSpeechClient(configuration);

    Button connectButton = (Button) findViewById(R.id.buttonConnect);
    connectButton.setOnClickListener(view -> speechClient.connect());

    recordButton = (Button) findViewById(R.id.buttonRecord);
    recordButton.setOnClickListener(view -> recordAudio());

    speechResultTextView = (TextView) findViewById(R.id.textViewSpeechResult);
    speechResultTextView.setMovementMethod(ScrollingMovementMethod.getInstance());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号