/// <summary> /// 播放声音 /// </summary> /// <param name="filePath">声音文件路径</param> /// <param name="isLoop">是否循环播放</param> /// <param name="interval">播放间隔</param> public void PlaySound(string filePath, bool isLoop, int interval) { if (null != CurrentAudioOutputDevice) { var errno = PlcmProxy.StartPlayAlert(filePath, isLoop, interval); if (ErrorNumber.OK != errno) { var errMsg = "开启铃声播放失败,ErrorNo=" + errno; log.Error(errMsg); throw new Exception(errMsg); } log.Info("开启铃声播放成功 filePath:" + filePath); } }