improved the code so that we can use the AudioPlayerState directly to check the playback speed and added localization

This commit is contained in:
Mauro Romito
2026-02-19 16:05:58 +01:00
committed by Mauro
parent 5f724941ee
commit a0be508691
13 changed files with 51 additions and 48 deletions

View File

@@ -458,4 +458,17 @@ enum VoiceMessagePlaybackSpeed: Float, CaseIterable, Codable {
case fast = 1.5
case fastest = 2.0
case slow = 0.5
var label: String {
switch self {
case .default, .fastest:
rawValue.formatted(.number.precision(.fractionLength(0))) + "×"
case .fast, .slow:
rawValue.formatted(.number.precision(.fractionLength(1))) + "×"
}
}
var placeholder: String {
0.0.formatted(.number.precision(.fractionLength(1))) + "×"
}
}