Skip to content

Commit

Permalink
Found the bug, partial fix
Browse files Browse the repository at this point in the history
Signed-off-by: rapterjet2004 <[email protected]>
  • Loading branch information
rapterjet2004 committed Nov 20, 2023
1 parent e659456 commit 7860f2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2183,16 +2183,16 @@ class ChatActivity :
recorder?.apply {
try {
Log.d(TAG, "recording stopped with $voiceRecordDuration")
if (voiceRecordDuration > MINIMUM_VOICE_RECORD_TO_STOP) {
try {
stop()
isVoiceRecordingInProgress = false
Log.d(TAG, "stopped recorder. isVoiceRecordingInProgress = false")
} catch (e: java.lang.RuntimeException) {
Log.e(TAG, "error while stopping recorder!" + e)
}
release()
isVoiceRecordingInProgress = false
Log.d(TAG, "stopped recorder. isVoiceRecordingInProgress = false")
} catch (e: java.lang.IllegalStateException) {
error("error while stopping recorder!" + e)
} catch (e: java.lang.RuntimeException) {
error("error while stopping recorder!" + e)
Log.e(TAG, "error while stopping recorder!" + e)
}

VibrationUtils.vibrateShort(context)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/nextcloud/talk/utils/AudioUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ object AudioUtils : DefaultLifecycleObserver {
val path = file.path
val mediaExtractor = MediaExtractor()
mediaExtractor.setDataSource(path)

// TODO this function assumes that the file is not null. Fix it.
// Basically just boilerplate to set up meta data for the audio file
val mediaFormat = mediaExtractor.getTrackFormat(0)
// Frame rate is required for encoders, optional for decoders. So we set it to null here.
Expand Down

0 comments on commit 7860f2d

Please sign in to comment.