Use .mka extension instead of .mkv for voice recordings, use .smff instead of mkv for call recordings

This commit is contained in:
Sylvain Berfini 2024-08-21 12:55:16 +02:00
parent ace4caca3f
commit 7fb3a6ada3
2 changed files with 5 additions and 3 deletions

View file

@ -43,6 +43,7 @@ import org.linphone.core.ChatRoom
import org.linphone.core.ChatRoomListenerStub
import org.linphone.core.EventLog
import org.linphone.core.Factory
import org.linphone.core.MediaFileFormat
import org.linphone.core.Player
import org.linphone.core.PlayerListener
import org.linphone.core.Recorder
@ -487,7 +488,7 @@ class SendMessageInConversationViewModel @UiThread constructor() : GenericViewMo
val core = coreContext.core
Log.i("$TAG Creating voice message recorder")
val recorderParams = core.createRecorderParams()
recorderParams.fileFormat = Recorder.FileFormat.Mkv
recorderParams.fileFormat = MediaFileFormat.Mkv
val recordingAudioDevice = AudioUtils.getAudioRecordingDeviceIdForVoiceMessage()
recorderParams.audioDevice = recordingAudioDevice
@ -516,7 +517,8 @@ class SendMessageInConversationViewModel @UiThread constructor() : GenericViewMo
}
Recorder.State.Closed -> {
val extension = when (voiceMessageRecorder.params.fileFormat) {
Recorder.FileFormat.Mkv -> "mkv"
MediaFileFormat.Smff -> "smff"
MediaFileFormat.Mkv -> "mka"
else -> "wav"
}
val tempFileName = "voice-recording-${System.currentTimeMillis()}.$extension"

View file

@ -56,7 +56,7 @@ class LinphoneUtils {
const val RECORDING_FILE_NAME_HEADER = "call_recording_"
const val RECORDING_FILE_NAME_URI_TIMESTAMP_SEPARATOR = "_on_"
const val RECORDING_FILE_EXTENSION = ".mkv"
const val RECORDING_FILE_EXTENSION = ".smff"
private const val CHAT_ROOM_ID_SEPARATOR = "#~#"