Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MediaRecorderManager : LifecycleAwareManager {
private const val VOICE_MESSAGE_ENCODING_BIT_RATE = 32000
private const val VOICE_MESSAGE_CHANNELS = 1
private const val FILE_DATE_PATTERN = "yyyy-MM-dd HH-mm-ss"
private const val VOICE_MESSAGE_FILE_SUFFIX = ".mp3"
private const val VOICE_MESSAGE_FILE_SUFFIX = ".m4a"
private const val VOICE_MESSAGE_PREFIX_MAX_LENGTH = 146
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ChatViewModelVoiceRecordingLifecycleTest {
@Before
fun setUp() {
whenever(mediaRecorderManager.mediaRecorderState).thenReturn(MediaRecorderState.RECORDING)
whenever(mediaRecorderManager.currentVoiceRecordFile).thenReturn("recording.mp3")
whenever(mediaRecorderManager.currentVoiceRecordFile).thenReturn("recording.m4a")
doAnswer { (it.arguments[1] as () -> Unit).invoke() }
.whenever(audioFocusRequestManager).audioFocusRequest(any(), any())
viewModel = newViewModel()
Expand All @@ -70,7 +70,7 @@ class ChatViewModelVoiceRecordingLifecycleTest {

@Test
fun `leaving the chat discards the recording and gives the audio focus back`() {
val file = kotlin.io.path.createTempFile(suffix = ".mp3").toFile()
val file = kotlin.io.path.createTempFile(suffix = ".m4a").toFile()
whenever(mediaRecorderManager.currentVoiceRecordFile).thenReturn(file.absolutePath)

viewModelStore.clear()
Expand Down Expand Up @@ -136,7 +136,7 @@ class ChatViewModelVoiceRecordingLifecycleTest {

@Test
fun `an interruption discards a recording that was still held`() {
val file = kotlin.io.path.createTempFile(suffix = ".mp3").toFile()
val file = kotlin.io.path.createTempFile(suffix = ".m4a").toFile()
whenever(mediaRecorderManager.currentVoiceRecordFile).thenReturn(file.absolutePath)

viewModel.interruptAudioRecording()
Expand Down
Loading