Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
this-Aditya committed Aug 1, 2024
1 parent 75c1602 commit 293c3f2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 32 deletions.
30 changes: 12 additions & 18 deletions plugins/radar-android-phone-audio-input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<br>
<img src="assets/images/audio_input_plugin/action_devices.jpg" width="200px" alt="action_devices"/>
<img src="assets/images/audio_input_plugin/recording_activity.jpg" width="200px" alt="recording_activity"/>
<br>

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.
<br>
<img src="assets/images/audio_input_plugin/recording_activity_devices.jpg" width="200px" alt="recording_activity_devices"/>
<img src="assets/images/audio_input_plugin/recording_activity_paused.jpg" width="200px" alt="recording_activity_paused"/>
<br>
<img src="assets/images/audio_input_plugin/action_devices.jpg" width="200px" alt="action_devices"/>
<img src="assets/images/audio_input_plugin/recording_activity.jpg" width="200px" alt="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.
<br>
<img src="assets/images/audio_input_plugin/alert_rec_ongoing.jpg" width="200px" alt="alert_rec_ongoing"/>
<img src="assets/images/audio_input_plugin/alert_rec_stopped.jpg" width="200px" alt="alert_rec_stopped"/>
<br>
<img src="assets/images/audio_input_plugin/recording_activity_devices.jpg" width="200px" alt="recording_activity_devices"/>
<img src="assets/images/audio_input_plugin/recording_activity_paused.jpg" width="200px" alt="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.
<br>
<img src="assets/images/audio_input_plugin/playback_frag.jpg" width="200px" alt="playback_frag"/>
<img src="assets/images/audio_input_plugin/playback_exit_alert.jpg" width="200px" alt="playback_exit_alert"/>
<br>
<img src="assets/images/audio_input_plugin/alert_rec_ongoing.jpg" width="200px" alt="alert_rec_ongoing"/>
<img src="assets/images/audio_input_plugin/alert_rec_stopped.jpg" width="200px" alt="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.


<img src="assets/images/audio_input_plugin/playback_frag.jpg" width="200px" alt="playback_frag"/>
<img src="assets/images/audio_input_plugin/playback_exit_alert.jpg" width="200px" alt="playback_exit_alert"/>
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 293c3f2

Please sign in to comment.