Commit e39984d88aa2132ae7dd4802e5fb88f15d786579
1 parent
2ee6209a
feat:修复先声录音对音频会话的类别和模式设置影响了音频输出,导致单通道出声(听筒)
Showing
1 changed file
with
3 additions
and
0 deletions
lib/pages/reading/bloc/reading_bloc.dart
| @@ -130,6 +130,7 @@ class ReadingPageBloc | @@ -130,6 +130,7 @@ class ReadingPageBloc | ||
| 130 | "setMethodCallHandler method=${call.method} arguments=${call.arguments}"); | 130 | "setMethodCallHandler method=${call.method} arguments=${call.arguments}"); |
| 131 | if (call.method == 'voiceResult') { | 131 | if (call.method == 'voiceResult') { |
| 132 | //评测结果 | 132 | //评测结果 |
| 133 | + await audioPlayer.setBalance(0.0); | ||
| 133 | add(XSVoiceResultEvent(call.arguments)); | 134 | add(XSVoiceResultEvent(call.arguments)); |
| 134 | return; | 135 | return; |
| 135 | } | 136 | } |
| @@ -150,6 +151,7 @@ class ReadingPageBloc | @@ -150,6 +151,7 @@ class ReadingPageBloc | ||
| 150 | print(call.method == 'voiceEnd' ? '评测结束' : '评测取消'); | 151 | print(call.method == 'voiceEnd' ? '评测结束' : '评测取消'); |
| 151 | } | 152 | } |
| 152 | _isRecording = false; | 153 | _isRecording = false; |
| 154 | + await audioPlayer.setBalance(0.0); | ||
| 153 | add(OnXSVoiceStateChangeEvent()); | 155 | add(OnXSVoiceStateChangeEvent()); |
| 154 | return; | 156 | return; |
| 155 | } | 157 | } |
| @@ -157,6 +159,7 @@ class ReadingPageBloc | @@ -157,6 +159,7 @@ class ReadingPageBloc | ||
| 157 | if (call.method == 'voiceFail') { | 159 | if (call.method == 'voiceFail') { |
| 158 | //评测失败 | 160 | //评测失败 |
| 159 | _isRecording = false; | 161 | _isRecording = false; |
| 162 | + await audioPlayer.setBalance(0.0); | ||
| 160 | EasyLoading.showToast('评测失败'); | 163 | EasyLoading.showToast('评测失败'); |
| 161 | return; | 164 | return; |
| 162 | } | 165 | } |