Replaced Recorder.FileFormat by MediaFileFormat

This commit is contained in:
Sylvain Berfini 2024-09-05 10:27:41 +02:00
parent 99dfab9139
commit 92b8a89ba7

View file

@ -382,7 +382,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
} }
Recorder.State.Closed -> { Recorder.State.Closed -> {
val extension = when (recorder.params.fileFormat) { val extension = when (recorder.params.fileFormat) {
Recorder.FileFormat.Mkv -> "mkv" MediaFileFormat.Mkv -> "mkv"
else -> "wav" else -> "wav"
} }
val tempFileName = "voice-recording-${System.currentTimeMillis()}.$extension" val tempFileName = "voice-recording-${System.currentTimeMillis()}.$extension"
@ -525,9 +525,9 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
Log.i("[Chat Message Sending] Creating recorder for voice message") Log.i("[Chat Message Sending] Creating recorder for voice message")
val recorderParams = coreContext.core.createRecorderParams() val recorderParams = coreContext.core.createRecorderParams()
if (corePreferences.voiceMessagesFormatMkv) { if (corePreferences.voiceMessagesFormatMkv) {
recorderParams.fileFormat = Recorder.FileFormat.Mkv recorderParams.fileFormat = MediaFileFormat.Mkv
} else { } else {
recorderParams.fileFormat = Recorder.FileFormat.Wav recorderParams.fileFormat = MediaFileFormat.Wav
} }
val recordingAudioDevice = AudioRouteUtils.getAudioRecordingDeviceForVoiceMessage() val recordingAudioDevice = AudioRouteUtils.getAudioRecordingDeviceForVoiceMessage()