PlaySound static method

void PlaySound(
  1. int index
)

播放提示音,0:自己开始讲话,1:自己结束讲话,2:讲话失败,3:别人开始讲话,4:别人结束讲话

Implementation

static void PlaySound(int index) {
  Log.i(tag, "PlaySound:$index");
  //如果关闭对讲,则不播放提示音
  if (!settingChangeNotifier.enablePTT) {
    return;
  }

  //对方讲话播放提示音(自己讲话已经在录音类里播放提示音)
  //播放提示音会导致对讲播放被打断,故暂时只有结束播放才播放提示音
  if (index == 3 || index == 4) {
    playBeepAudio();
  } else if (index == 2) {
    playText(getTranslation("PttBusy"), true);
  }
}