cph-cachet / carp_studies_app

The CARP Study App
MIT License
6 stars 1 forks source link

Audio task doesn't work #341

Open bardram opened 1 month ago

bardram commented 1 month ago

When clicking an audio task nothing happens.

Samsung Galaxy S10e Android 12.

[log] [CAMS INFO] Initializing BackgroundTaskExecutor [112496505] (created)
I/flutter (29483): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (29483): │ #0   new FlutterSoundRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:139:13)
I/flutter (29483): │ #1   new AudioProbe (package:carp_audio_package/audio_probe.dart:20:21)
I/flutter (29483): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (29483): │ 🐛 ctor: FlutterSoundRecorder()
I/flutter (29483): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[log] [CAMS INFO] Initializing AudioProbe [399478870] (created)
[log] [CAMS INFO] Initializing LocationProbe [919669977] (created)
bardram commented 1 month ago

The first problem is that the widget parameter wasn't set.

The second problem was that the audio meaurement wasn't added to the overall stream of measurements and hence not stored locall in the DB.

This latter problem only occurs when the audio measure is part of an AppTask.

The problem is that the UserTask is stopped (onDone() called) BEFORE the audio probe has time to stop and generate the audio measurement. So - once the measurement is generated and added to the stream of measurements, the background executor has been removed from the overall stream of measurements (the group).