diff --git a/WordPress/src/main/java/org/wordpress/android/util/audio/AudioRecorder.kt b/WordPress/src/main/java/org/wordpress/android/util/audio/AudioRecorder.kt index 7b6f73ad6d90..283d18593793 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/audio/AudioRecorder.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/audio/AudioRecorder.kt @@ -150,10 +150,12 @@ class AudioRecorder( delay(RECORDING_UPDATE_INTERVAL) elapsedTimeInSeconds += (RECORDING_UPDATE_INTERVAL / 1000).toInt() val fileSize = File(filePath).length() + val amplitude = recorder?.maxAmplitude?.toFloat() ?: 0f _recordingUpdates.value = RecordingUpdate( elapsedTime = elapsedTimeInSeconds, fileSize = fileSize, fileSizeLimitExceeded = fileSize >= recordingStrategy.maxFileSize, + amplitudes = listOf(amplitude) ) if ( maxFileSizeExceeded(fileSize) || maxDurationExceeded(elapsedTimeInSeconds) ) { diff --git a/WordPress/src/main/java/org/wordpress/android/util/audio/RecordingUpdate.kt b/WordPress/src/main/java/org/wordpress/android/util/audio/RecordingUpdate.kt index fbd7ceabce38..f067d6cff8a4 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/audio/RecordingUpdate.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/audio/RecordingUpdate.kt @@ -3,5 +3,6 @@ package org.wordpress.android.util.audio data class RecordingUpdate( val elapsedTime: Int = 0, // in seconds val fileSize: Long = 0L, // in bytes - val fileSizeLimitExceeded: Boolean = false + val fileSizeLimitExceeded: Boolean = false, + val amplitudes: List = emptyList() )