Skip to content

Commit

Permalink
Disable including audio in-recording when it starts disabled
Browse files Browse the repository at this point in the history
(temporary workaround until CameraX fix)
  • Loading branch information
MHShetty authored and thestinger committed Jul 23, 2024
1 parent 1298b52 commit c352588
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import java.util.Date
import java.util.Locale

class VideoCapturer(private val mActivity: MainActivity) {

val camConfig = mActivity.camConfig

var isRecording = false
Expand All @@ -47,6 +48,8 @@ class VideoCapturer(private val mActivity: MainActivity) {

private var recording: Recording? = null

var includeAudio: Boolean = false

var isPaused = false
set(value) {
if (isRecording) {
Expand Down Expand Up @@ -166,7 +169,7 @@ class VideoCapturer(private val mActivity: MainActivity) {
val dateString = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US).format(Date())
val fileName = VIDEO_NAME_PREFIX + dateString + videoFileFormat

var includeAudio = false
includeAudio = false

val ctx = mActivity

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/app/grapheneos/camera/ui/SettingsDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ class SettingsDialog(val mActivity: MainActivity) :
return@setOnClickListener
}

if (!mActivity.videoCapturer.includeAudio) {
mActivity.showMessage("Enabling audio while recording is not currently supported when it was disabled at the start")
includeAudioToggle.isChecked = false
return@setOnClickListener
}

if (includeAudioToggle.isChecked) {
mActivity.videoCapturer.unmuteRecording()
} else {
Expand Down

0 comments on commit c352588

Please sign in to comment.