mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-28 20:40:13 +02:00
fix(core/send_override): audio note transcription
This commit is contained in:
parent
8864be6814
commit
da19408c75
@ -13,6 +13,7 @@ import me.rhunk.snapenhance.core.features.impl.experiments.MediaFilePicker
|
|||||||
import me.rhunk.snapenhance.core.messaging.MessageSender
|
import me.rhunk.snapenhance.core.messaging.MessageSender
|
||||||
import me.rhunk.snapenhance.core.ui.ViewAppearanceHelper
|
import me.rhunk.snapenhance.core.ui.ViewAppearanceHelper
|
||||||
import me.rhunk.snapenhance.nativelib.NativeLib
|
import me.rhunk.snapenhance.nativelib.NativeLib
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INIT_SYNC) {
|
class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INIT_SYNC) {
|
||||||
private var isLastSnapSavable = false
|
private var isLastSnapSavable = false
|
||||||
@ -129,7 +130,10 @@ class SendOverride : Feature("Send Override", loadParams = FeatureLoadParams.INI
|
|||||||
"NOTE" -> {
|
"NOTE" -> {
|
||||||
localMessageContent.contentType = ContentType.NOTE
|
localMessageContent.contentType = ContentType.NOTE
|
||||||
localMessageContent.content =
|
localMessageContent.content =
|
||||||
MessageSender.audioNoteProto(messageProtoReader.getVarInt(3, 3, 5, 1, 1, 15) ?: context.feature(MediaFilePicker::class).lastMediaDuration ?: 0)
|
MessageSender.audioNoteProto(
|
||||||
|
messageProtoReader.getVarInt(3, 3, 5, 1, 1, 15) ?: context.feature(MediaFilePicker::class).lastMediaDuration ?: 0,
|
||||||
|
Locale.getDefault().toLanguageTag()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class MessageSender(
|
|||||||
}.toByteArray()
|
}.toByteArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
val audioNoteProto: (Long) -> ByteArray = { duration ->
|
val audioNoteProto: (Long, String?) -> ByteArray = { duration, userLocale ->
|
||||||
ProtoWriter().apply {
|
ProtoWriter().apply {
|
||||||
from(6, 1) {
|
from(6, 1) {
|
||||||
from(1) {
|
from(1) {
|
||||||
@ -50,6 +50,9 @@ class MessageSender(
|
|||||||
addVarInt(7, 0)
|
addVarInt(7, 0)
|
||||||
addVarInt(13, duration)
|
addVarInt(13, duration)
|
||||||
}
|
}
|
||||||
|
if (userLocale != null) {
|
||||||
|
addString(3, userLocale)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.toByteArray()
|
}.toByteArray()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user