dialogflow / dialogflow-android-client

Android SDK for Dialogflow
https://dialogflow.com
Apache License 2.0
575 stars 270 forks source link

setRecognizerSound doesn't work #55

Open anonym24 opened 7 years ago

anonym24 commented 7 years ago

Seems to be setRecognizer*Sound methods don't work (it still plays default beep sounds):

config.setRecognizerStartSound(my_audio);
config.setRecognizerStopSound(my_audio);
config.setRecognizerCancelSound(my_audio);

I tried sample app:

public class AIDialogSampleActivity extends BaseActivity implements AIDialog.AIDialogListener {

    private static final String TAG = AIDialogSampleActivity.class.getName();

    private TextView resultTextView;
    private AIDialog aiDialog;

    private Gson gson = GsonFactory.getGson();

    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_aidialog_sample);

        resultTextView = (TextView) findViewById(R.id.resultTextView);

        Resources resources = getResources();
        AssetFileDescriptor audio = resources.openRawResourceFd(R.raw.audio);

        final AIConfiguration config = new AIConfiguration(Config.ACCESS_TOKEN,
                AIConfiguration.SupportedLanguages.English,
                AIConfiguration.RecognitionEngine.System);
        config.setRecognizerStartSound(audio);
        config.setRecognizerStopSound(audio);
        config.setRecognizerCancelSound(audio);

        aiDialog = new AIDialog(this, config);
        aiDialog.setResultsListener(this);
    }
anonym24 commented 7 years ago

Mb someone know how to disable this beep for Google Speech? Already asked on https://stackoverflow.com/questions/45380043/stop-speechrecognizer-from-requesting-audio-focus but no answers