瀏覽代碼

优化代码

Pq 1 年之前
父節點
當前提交
87876854b6
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      accompany/src/main/java/com/daya/orchestra/accompany/web/AccompanyFragment.java

+ 1 - 1
accompany/src/main/java/com/daya/orchestra/accompany/web/AccompanyFragment.java

@@ -733,7 +733,7 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
 //                                } catch (JSONException e) {
 //                                    e.printStackTrace();
 //                                }
-                                long bufferDuration = (long) wavRecorder.getBufferDuration();
+                                long bufferDuration = wavRecorder != null ? (long) wavRecorder.getBufferDuration() : 0;
                                 long time = System.currentTimeMillis();
                                 long result = time - bufferDuration;
                                 mPlayHelper.toPlay2(result, getFirstNoteTime(message), isMuteMode(message));