From 293c3f210c8bb11fbeb87865f814dcc56cea51d6 Mon Sep 17 00:00:00 2001 From: this-Aditya Date: Thu, 1 Aug 2024 11:57:52 +0530 Subject: [PATCH] Minor changes --- .../radar-android-phone-audio-input/README.md | 30 ++++++++----------- .../audio/input/PhoneAudioInputManager.kt | 28 ++++++++--------- 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/plugins/radar-android-phone-audio-input/README.md b/plugins/radar-android-phone-audio-input/README.md index 2b4319700..7114b5e09 100644 --- a/plugins/radar-android-phone-audio-input/README.md +++ b/plugins/radar-android-phone-audio-input/README.md @@ -67,32 +67,26 @@ This plugin provides an interactive UI for recording and managing audio data. Be - **Data Sending**: Users can send the recorded audio data for storing to s3. ### Guide for Using the PhoneAudioInput Plugin -
-action_devices -recording_activity -
+ 1. In the main activity, where plugins are visible along with their actions (if any), click on the specific action for the **Phone Audio Input** plugin. - This will redirect you to the first activity of the Phone Audio Input plugin. -
-recording_activity_devices -recording_activity_paused -
+ action_devices + recording_activity + 2. At the top of this activity, there is a dropdown menu for selecting microphones. - The current input routing microphone is shown by default in the dropdown menu when it is collapsed. - Click on the refresh button near dropdown menu to refresh microphones. - Select your preferred microphone from the dropdown menu. If no preferred microphone is selected, the automatic device selection logic will take place. -
-alert_rec_ongoing -alert_rec_stopped -
+ recording_activity_devices + recording_activity_paused + 3. Click **Start Recording** to begin recording audio. - While recording, you can pause or resume the recording. - Do not quit the recording activity while recording is in progress or paused, as this may cause the application to misbehave. An alert will also be shown if you attempt to quit the activity in a recording or paused state. You can safely quit the activity after stopping the recording. -
-playback_frag -playback_exit_alert -
+ alert_rec_ongoing + alert_rec_stopped + 4. After stopping the recording, an alert dialog will appear with three options: play the recorded audio, send it directly without playing, or discard it. - If you click **Play**, you will be redirected to a new fragment for listening to the last recorded audio. Here, you can review the recording and send it after listening. - - + playback_frag + playback_exit_alert diff --git a/plugins/radar-android-phone-audio-input/src/main/java/org/radarbase/passive/phone/audio/input/PhoneAudioInputManager.kt b/plugins/radar-android-phone-audio-input/src/main/java/org/radarbase/passive/phone/audio/input/PhoneAudioInputManager.kt index 9d8cb2d40..e07522a01 100644 --- a/plugins/radar-android-phone-audio-input/src/main/java/org/radarbase/passive/phone/audio/input/PhoneAudioInputManager.kt +++ b/plugins/radar-android-phone-audio-input/src/main/java/org/radarbase/passive/phone/audio/input/PhoneAudioInputManager.kt @@ -279,21 +279,21 @@ class PhoneAudioInputManager(service: PhoneAudioInputService) : AbstractSourceMa private fun clearAudioDirectory() { payloadSize = 0 - audioDir?.let { audioDir -> - audioDir.parentFile - ?.list { _, name -> name.startsWith("phone_audio_input") && name.endsWith(".wav") } - ?.forEach { - File(audioDir.parentFile, it).delete() - logger.debug("Deleted audio file: {}", it) - } + audioDir?.let { audioDir -> + audioDir.parentFile + ?.list { _, name -> name.startsWith("phone_audio_input") && name.endsWith(".wav") } + ?.forEach { + File(audioDir.parentFile, it).delete() + logger.debug("Deleted audio file: {}", it) + } - audioDir.walk() - .filter { it.name.startsWith("phone_audio_input") && it.path.endsWith(".wav") } - .forEach { - it.delete() - logger.debug("Deleted file: {}", it) - } - } + audioDir.walk() + .filter { it.name.startsWith("phone_audio_input") && it.path.endsWith(".wav") } + .forEach { + it.delete() + logger.debug("Deleted file: {}", it) + } + } } private fun startAudioRecording() {