char5742 / flutter_silero_vad

This is an unofficial plugin for calling the Silero VAD ONNX model in Flutter.
Other
28 stars 15 forks source link

The app crashes when tapping the 'Start' button on the example - Flutter iOS device. #6

Closed zxl777 closed 9 months ago

zxl777 commented 9 months ago

await ref.read(audioServiceProvider).play();

Error configuring audio session

image
char5742 commented 9 months ago

Thank you for bringing this issue to our attention.I have addressed and resolved it in the latest commit. You can review the changes here: https://github.com/char5742/flutter_silero_vad/blob/93d308935761b103bc73aaa75e7e879b8aa93075/example/lib/services/audio.dart#L15-L17 Please let me know if there are any further issues or concerns.

zxl777 commented 9 months ago

I've tested the latest commit on an iPhone 12 mini running iOS 17.2.1. Now, I can tap the Start button to replay my sound. However, when I try to say "1 [pause] 2 [pause] 3 [pause] 4 [pause] 5 [pause] 6 [pause] 7 [pause] 8," the playback is inconsistent. Sometimes I can hear "1 2 3 4 5," and at other times, I only hear "6 7 8." The sound playback is not complete. #7

Additionally, I encountered a crash, as shown in the attached screenshot.

image
char5742 commented 9 months ago

I have also confirmed this issue on my end. However, I have not yet identified the specific problem area. Please wait a while as I continue to investigate.

zxl777 commented 9 months ago

Thank you, I will test it as soon as the issue is resolved.

I hope to use this module for all-day recording, followed by transcription, for the purpose of learning a second language. Therefore, complete segment recordings are important. Additionally, energy consumption needs to be considered.

char5742 commented 9 months ago

The bug has been identified; it's on the playback side. Currently, we're using audioplayers, but changing the file storage to 'document' and playing directly from the iPhone's file app results in all audio playing without issue.

If you wish to use it for transcription, there's no need to play it directly with audioplayers, right? With the path_provider library, you can save the recording file to an easily accessible location from the file app as follows:

String outputPath =
          '${(await getApplicationDocumentsDirectory()).path}/output.wav';
zxl777 commented 9 months ago

I've figured out the issue. When I recite "ABCDEFGHIJK" aloud, the recording is perfect. However, when I say "1, 2, 3, 4, 5, 6, 7, 8, 9, 10" in Chinese, only the sound of "10" is captured.