File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
android/SherpaOnnxTtsEngine/app/src/main/java/com/k2fsa/sherpa/onnx/tts/engine Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -177,8 +177,6 @@ class MainActivity : ComponentActivity() {
177177 rtfText = " "
178178 Log .i(TAG , " Started with text $testText " )
179179
180- samplesChannel = Channel <FloatArray >()
181-
182180 CoroutineScope (Dispatchers .IO ).launch {
183181 for (samples in samplesChannel) {
184182 track.write(
@@ -191,6 +189,10 @@ class MainActivity : ComponentActivity() {
191189 break
192190 }
193191 }
192+
193+ for (s in samplesChannel) {
194+ // drain the channel
195+ }
194196 }
195197
196198 CoroutineScope (Dispatchers .Default ).launch {
@@ -219,7 +221,6 @@ class MainActivity : ComponentActivity() {
219221 audioDuration,
220222 elapsed / audioDuration
221223 )
222- samplesChannel.close()
223224
224225 val filename =
225226 application.filesDir.absolutePath + " /generated.wav"
You can’t perform that action at this time.
0 commit comments