chore: skip short audio in audio practice (#5749)

This commit is contained in:
ggurdin 2026-02-18 15:10:56 -05:00 committed by GitHub
parent f7539c184f
commit 13700d9a9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -500,6 +500,11 @@ class AnalyticsPracticeState extends State<AnalyticsPractice>
activity.langCode,
MatrixState.pangeaController.userController.voice,
);
if (audioFile.duration == null || audioFile.duration! <= 2000) {
throw "Audio file too short";
}
// Prefetch the translation
final translation = await pangeaEvent.requestRespresentationByL1();
_audioFiles[eventId] = audioFile;