add VoicePreset enum for voice anonymization

Define preset options (None, Deep, High, Neutral)
This commit is contained in:
davotoula
2026-01-12 11:44:40 +01:00
parent bfd0fc01b9
commit 83d4d3e756
3 changed files with 40 additions and 0 deletions
@@ -0,0 +1,35 @@
/**
* Copyright (c) 2025 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.ui.actions.uploads
import androidx.annotation.StringRes
import com.vitorpamplona.amethyst.R
enum class VoicePreset(
val pitchFactor: Double,
val formantShift: Double,
@StringRes val labelRes: Int,
) {
NONE(1.0, 0.0, R.string.voice_preset_none),
DEEP(0.75, -3.0, R.string.voice_preset_deep),
HIGH(1.4, 4.0, R.string.voice_preset_high),
NEUTRAL(1.0, -2.0, R.string.voice_preset_neutral),
}
+4
View File
@@ -184,6 +184,10 @@
<string name="upload_error_voice_message_unexpected_state">Unexpected upload state</string>
<string name="upload_error_voice_message_nip95_not_supported">NIP-95 is not supported for voice messages yet</string>
<string name="upload_error_voice_message_exception">Voice upload failed: %1$s</string>
<string name="voice_preset_none">None</string>
<string name="voice_preset_deep">Deep</string>
<string name="voice_preset_high">High</string>
<string name="voice_preset_neutral">Neutral</string>
<string name="user_does_not_have_a_lightning_address_setup_to_receive_sats">User does not have a lightning address set up to receive sats</string>
<string name="reply_here">"reply here.. "</string>
<string name="copies_the_note_id_to_the_clipboard_for_sharing">Copies the Note ID to the clipboard for sharing in Nostr</string>