|
@@ -736,7 +736,7 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
|
|
|
long bufferDuration = (long) wavRecorder.getBufferDuration();
|
|
|
long time = System.currentTimeMillis();
|
|
|
long result = time - bufferDuration;
|
|
|
- mPlayHelper.toPlay2(result,isMuteMode(message));
|
|
|
+ mPlayHelper.toPlay2(result,getFirstNoteTime(message),isMuteMode(message));
|
|
|
} else if ("1".equals(recorder)) {
|
|
|
// onSendMessage(message.toString());
|
|
|
} else {
|
|
@@ -783,6 +783,19 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private int getFirstNoteTime(JSONObject jsonObject){
|
|
|
+ if (jsonObject == null) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ JSONObject contentJson = jsonObject.optJSONObject("content");
|
|
|
+ //获取选段位置
|
|
|
+ if (contentJson != null) {
|
|
|
+ int firstNoteTime = contentJson.optInt("firstNoteTime", 0);
|
|
|
+ return firstNoteTime;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
private boolean isMuteMode(JSONObject jsonObject) {
|
|
|
if (jsonObject == null) {
|
|
|
return false;
|