feat: custom capture sounds
This commit is contained in:
1 parent
f7f0facabd
commit
a0c9f16768
19 files changed
+578
-112
No files matched your search
@@ -37,7 +37,8 @@ object BackupManager {
|
||||
"custom_dcps",
|
||||
"custom_raw_noise_profiles",
|
||||
"custom_fonts",
|
||||
"custom_logos"
|
||||
"custom_logos",
|
||||
"capture_sounds"
|
||||
)
|
||||
|
||||
// These imported profiles describe a particular camera sensor and must stay with its device.
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.hinnka.mycamera.data
|
||||
|
||||
import android.content.Context
|
||||
import android.media.MediaExtractor
|
||||
import android.media.MediaFormat
|
||||
import android.net.Uri
|
||||
import android.provider.OpenableColumns
|
||||
import com.hinnka.mycamera.utils.PLog
|
||||
import com.hinnka.mycamera.utils.ShutterSoundPlayer
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.NonCancellable
|
||||
import kotlinx.coroutines.ensureActive
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
import java.util.UUID
|
||||
import kotlin.coroutines.coroutineContext
|
||||
|
||||
/** Owns imported files; preferences store portable names relative to the backed-up directory. */
|
||||
class CaptureSoundRepository(
|
||||
private val context: Context,
|
||||
private val preferences: UserPreferencesRepository,
|
||||
) {
|
||||
companion object {
|
||||
private const val DIRECTORY = "capture_sounds"
|
||||
private const val MAX_FILE_BYTES = 10 * 1024 * 1024
|
||||
|
||||
fun resolve(context: Context, fileName: String?): File? {
|
||||
if (fileName == null) return null
|
||||
require(fileName.isNotBlank() && fileName != "." && fileName != ".." &&
|
||||
'/' !in fileName && '\\' !in fileName) { "Invalid capture sound name" }
|
||||
return File(File(context.filesDir, DIRECTORY), fileName)
|
||||
}
|
||||
|
||||
fun displayName(fileName: String): String = fileName.substringAfter('_')
|
||||
}
|
||||
|
||||
private val mutex = Mutex()
|
||||
|
||||
suspend fun import(isBurst: Boolean, uri: Uri) = mutex.withLock {
|
||||
withContext(Dispatchers.IO) {
|
||||
val directory = File(context.filesDir, DIRECTORY)
|
||||
check(directory.isDirectory || directory.mkdirs()) { "Cannot create sound directory" }
|
||||
val name = context.contentResolver.query(
|
||||
uri, arrayOf(OpenableColumns.DISPLAY_NAME), null, null, null
|
||||
)?.use { cursor ->
|
||||
if (cursor.moveToFirst()) cursor.getString(0) else null
|
||||
} ?: uri.lastPathSegment.orEmpty()
|
||||
val safeName = name.map { if (it == '/' || it == '\\' || it.isISOControl()) '_' else it }
|
||||
.joinToString("").take(40).ifBlank { "audio" }
|
||||
val file = File(directory, "${UUID.randomUUID()}_$safeName")
|
||||
var committed = false
|
||||
try {
|
||||
context.contentResolver.openInputStream(uri)?.use { input ->
|
||||
file.outputStream().use { output ->
|
||||
val buffer = ByteArray(8192)
|
||||
var total = 0
|
||||
while (true) {
|
||||
coroutineContext.ensureActive()
|
||||
val count = input.read(buffer)
|
||||
if (count < 0) break
|
||||
total += count
|
||||
require(total <= MAX_FILE_BYTES) { "Audio file exceeds size limit" }
|
||||
output.write(buffer, 0, count)
|
||||
}
|
||||
}
|
||||
} ?: error("Cannot open selected audio")
|
||||
validateFormat(file)
|
||||
check(ShutterSoundPlayer.validate(file)) { "SoundPool cannot decode selected audio" }
|
||||
// File ownership and the preference update must commit together, even on cancellation.
|
||||
withContext(NonCancellable) {
|
||||
val previous = currentFileName(isBurst)
|
||||
preferences.saveCaptureSound(isBurst, file.name)
|
||||
committed = true
|
||||
deletePrevious(previous)
|
||||
}
|
||||
} finally {
|
||||
if (!committed) file.delete()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun reset(isBurst: Boolean) = mutex.withLock {
|
||||
withContext(Dispatchers.IO + NonCancellable) {
|
||||
val previous = currentFileName(isBurst)
|
||||
preferences.saveCaptureSound(isBurst, null)
|
||||
deletePrevious(previous)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun currentFileName(isBurst: Boolean): String? {
|
||||
val current = preferences.userPreferences.first()
|
||||
return if (isBurst) current.burstSoundFileName else current.shutterSoundFileName
|
||||
}
|
||||
|
||||
private suspend fun deletePrevious(fileName: String?) {
|
||||
// A restored configuration may reference the same clip for both capture modes.
|
||||
val current = preferences.userPreferences.first()
|
||||
if (fileName == current.shutterSoundFileName || fileName == current.burstSoundFileName) return
|
||||
runCatching {
|
||||
resolve(context, fileName)?.let { file ->
|
||||
if (file.exists() && !file.delete()) PLog.w("CaptureSoundRepository", "Cannot delete ${file.name}")
|
||||
}
|
||||
}.onFailure { PLog.w("CaptureSoundRepository", "Cannot remove previous sound", it) }
|
||||
}
|
||||
|
||||
private fun validateFormat(file: File) {
|
||||
val extractor = MediaExtractor()
|
||||
try {
|
||||
extractor.setDataSource(file.absolutePath)
|
||||
require(extractor.trackCount == 1) { "Expected a single audio track" }
|
||||
val format = extractor.getTrackFormat(0)
|
||||
require(format.getString(MediaFormat.KEY_MIME)?.startsWith("audio/") == true)
|
||||
val durationUs = format.getLong(MediaFormat.KEY_DURATION)
|
||||
val sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE)
|
||||
val channels = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT)
|
||||
// SoundPool truncates decoded samples above 1 MB. These limits keep PCM below 576 KB.
|
||||
require(durationUs in 1..3_000_000L && sampleRate in 1..48_000 && channels in 1..2) {
|
||||
"Unsupported audio parameters: duration=$durationUs, rate=$sampleRate, channels=$channels"
|
||||
}
|
||||
} finally {
|
||||
extractor.release()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,6 +157,8 @@ data class UserPreferences(
|
||||
val focusPeakingEnabled: Boolean = true, // 手动对焦峰值显示
|
||||
val eyeFocusEnabled: Boolean = false, // MediaPipe 人眼对焦
|
||||
val shutterSoundEnabled: Boolean = true, // 快门声音
|
||||
val shutterSoundFileName: String? = null,
|
||||
val burstSoundFileName: String? = null,
|
||||
val vibrationEnabled: Boolean = true, // 拍摄震动
|
||||
val keepScreenOn: Boolean = false, // 屏幕常亮
|
||||
val windowScreenBrightness: Float? = null, // Activity 窗口屏幕亮度,null 表示使用系统默认
|
||||
@@ -405,6 +407,8 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
private val FOCUS_PEAKING_ENABLED = booleanPreferencesKey("focus_peaking_enabled")
|
||||
private val EYE_FOCUS_ENABLED = booleanPreferencesKey("eye_focus_enabled")
|
||||
private val SHUTTER_SOUND_ENABLED = booleanPreferencesKey("shutter_sound_enabled")
|
||||
private val SHUTTER_SOUND_FILE_NAME = stringPreferencesKey("shutter_sound_file_name")
|
||||
private val BURST_SOUND_FILE_NAME = stringPreferencesKey("burst_sound_file_name")
|
||||
private val VIBRATION_ENABLED = booleanPreferencesKey("vibration_enabled")
|
||||
private val KEEP_SCREEN_ON = booleanPreferencesKey("keep_screen_on")
|
||||
private val WINDOW_SCREEN_BRIGHTNESS = floatPreferencesKey("window_screen_brightness")
|
||||
@@ -686,6 +690,8 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
focusPeakingEnabled = preferences[FOCUS_PEAKING_ENABLED] ?: true,
|
||||
eyeFocusEnabled = preferences[EYE_FOCUS_ENABLED] ?: false,
|
||||
shutterSoundEnabled = preferences[SHUTTER_SOUND_ENABLED] ?: true,
|
||||
shutterSoundFileName = preferences[SHUTTER_SOUND_FILE_NAME],
|
||||
burstSoundFileName = preferences[BURST_SOUND_FILE_NAME],
|
||||
vibrationEnabled = preferences[VIBRATION_ENABLED] ?: true,
|
||||
keepScreenOn = preferences[KEEP_SCREEN_ON] ?: false,
|
||||
windowScreenBrightness = preferences[WINDOW_SCREEN_BRIGHTNESS]?.coerceIn(0f, 1f),
|
||||
@@ -1517,6 +1523,13 @@ class UserPreferencesRepository(private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun saveCaptureSound(isBurst: Boolean, fileName: String?) {
|
||||
context.dataStore.edit { preferences ->
|
||||
val key = if (isBurst) BURST_SOUND_FILE_NAME else SHUTTER_SOUND_FILE_NAME
|
||||
if (fileName == null) preferences.remove(key) else preferences[key] = fileName
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存是否启用拍摄震动
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.hinnka.mycamera.ui.settings
|
||||
|
||||
import android.widget.Toast
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||
import androidx.compose.foundation.layout.FlowRow
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.hinnka.mycamera.R
|
||||
import com.hinnka.mycamera.data.CaptureSoundRepository
|
||||
import com.hinnka.mycamera.utils.ShutterSoundPlayer
|
||||
import com.hinnka.mycamera.viewmodel.CameraViewModel
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Composable
|
||||
internal fun CaptureSoundSetting(viewModel: CameraViewModel) {
|
||||
val preferences by viewModel.userPreferences.collectAsState()
|
||||
val importing by viewModel.captureSoundImporting.collectAsState()
|
||||
val context = LocalContext.current
|
||||
val scope = rememberCoroutineScope()
|
||||
var pendingBurst by rememberSaveable { mutableStateOf<Boolean?>(null) }
|
||||
var previewing by remember { mutableStateOf(false) }
|
||||
val previewPlayer = remember(context) { ShutterSoundPlayer(context.applicationContext) }
|
||||
|
||||
DisposableEffect(previewPlayer) {
|
||||
onDispose { previewPlayer.release() }
|
||||
}
|
||||
LaunchedEffect(previewPlayer, preferences.shutterSoundFileName, preferences.burstSoundFileName) {
|
||||
previewPlayer.configure(
|
||||
preferences.shutterSoundFileName,
|
||||
preferences.burstSoundFileName,
|
||||
)
|
||||
}
|
||||
LaunchedEffect(viewModel, context) {
|
||||
viewModel.captureSoundErrors.collect { message ->
|
||||
Toast.makeText(context, message, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
val launcher = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { uri ->
|
||||
val isBurst = pendingBurst
|
||||
pendingBurst = null
|
||||
if (uri != null && isBurst != null) viewModel.importCaptureSound(isBurst, uri)
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
Text(
|
||||
stringResource(R.string.settings_shutter_sound_custom_description),
|
||||
color = Color.White.copy(alpha = 0.6f),
|
||||
fontSize = 13.sp,
|
||||
)
|
||||
listOf(false, true).forEach { isBurst ->
|
||||
val fileName = if (isBurst) preferences.burstSoundFileName else preferences.shutterSoundFileName
|
||||
CaptureSoundRow(
|
||||
title = stringResource(
|
||||
if (isBurst) R.string.settings_shutter_sound_burst else R.string.settings_shutter_sound_single
|
||||
),
|
||||
fileName = fileName,
|
||||
enabled = !importing && !previewing && pendingBurst == null,
|
||||
onChoose = {
|
||||
previewPlayer.stopBurst()
|
||||
pendingBurst = isBurst
|
||||
launcher.launch("audio/*")
|
||||
},
|
||||
onPreview = {
|
||||
previewing = true
|
||||
scope.launch {
|
||||
try {
|
||||
if (!previewPlayer.preview(isBurst)) {
|
||||
Toast.makeText(context, R.string.settings_shutter_sound_preview_failed, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
} finally {
|
||||
previewing = false
|
||||
}
|
||||
}
|
||||
},
|
||||
onReset = {
|
||||
previewPlayer.stopBurst()
|
||||
viewModel.resetCaptureSound(isBurst)
|
||||
},
|
||||
)
|
||||
}
|
||||
if (importing) {
|
||||
Text(
|
||||
stringResource(R.string.settings_shutter_sound_importing),
|
||||
color = Color.White.copy(alpha = 0.6f),
|
||||
fontSize = 13.sp,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
private fun CaptureSoundRow(
|
||||
title: String,
|
||||
fileName: String?,
|
||||
enabled: Boolean,
|
||||
onChoose: () -> Unit,
|
||||
onPreview: () -> Unit,
|
||||
onReset: () -> Unit,
|
||||
) {
|
||||
Column(Modifier.fillMaxWidth()) {
|
||||
Text(title, color = Color.White, fontSize = 14.sp)
|
||||
Text(
|
||||
text = fileName?.let(CaptureSoundRepository::displayName)
|
||||
?: stringResource(R.string.settings_shutter_sound_default),
|
||||
color = Color.White.copy(alpha = 0.6f),
|
||||
fontSize = 13.sp,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
FlowRow(horizontalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
TextButton(onClick = onChoose, enabled = enabled) {
|
||||
Text(stringResource(R.string.settings_shutter_sound_choose))
|
||||
}
|
||||
TextButton(onClick = onPreview, enabled = enabled) {
|
||||
Text(stringResource(R.string.settings_shutter_sound_preview))
|
||||
}
|
||||
if (fileName != null) {
|
||||
TextButton(onClick = onReset, enabled = enabled) {
|
||||
Text(stringResource(R.string.settings_shutter_sound_reset))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2590,6 +2590,8 @@ fun SettingsScreen(
|
||||
onCheckedChange = { viewModel.setShutterSoundEnabled(it) }
|
||||
)
|
||||
|
||||
CaptureSoundSetting(viewModel)
|
||||
|
||||
HorizontalDivider(
|
||||
color = Color.White.copy(alpha = 0.1f),
|
||||
modifier = Modifier.padding(vertical = 8.dp)
|
||||
|
||||
@@ -3,134 +3,133 @@ package com.hinnka.mycamera.utils
|
||||
import android.content.Context
|
||||
import android.media.AudioAttributes
|
||||
import android.media.SoundPool
|
||||
import android.util.Log
|
||||
import java.io.IOException
|
||||
import com.hinnka.mycamera.data.CaptureSoundRepository
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* 快门音效播放器
|
||||
*
|
||||
* 负责播放拍照时的快门音效
|
||||
* 使用 SoundPool 实现低延迟播放
|
||||
*/
|
||||
/** Preloads each sound independently for low-latency capture, including looping burst audio. */
|
||||
class ShutterSoundPlayer(private val context: Context) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ShutterSoundPlayer"
|
||||
private const val SHUTTER_SOUND_PATH = "shutter.mp3"
|
||||
private const val BURST_SOUND_PATH = "burst.mp3"
|
||||
}
|
||||
|
||||
private var soundPool: SoundPool? = null
|
||||
private var soundId: Int = -1
|
||||
private var burstSoundId: Int = -1
|
||||
private var burstStreamId: Int = -1
|
||||
private var isLoaded = false
|
||||
|
||||
init {
|
||||
initializePlayer()
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化 SoundPool
|
||||
*/
|
||||
private fun initializePlayer() {
|
||||
try {
|
||||
val audioAttributes = AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||
.build()
|
||||
|
||||
soundPool = SoundPool.Builder()
|
||||
.setMaxStreams(1)
|
||||
.setAudioAttributes(audioAttributes)
|
||||
.build()
|
||||
|
||||
soundPool?.setOnLoadCompleteListener { _, _, status ->
|
||||
if (status == 0) {
|
||||
isLoaded = true
|
||||
PLog.d(TAG, "Shutter sound loaded successfully")
|
||||
} else {
|
||||
PLog.e(TAG, "Failed to load shutter sound, status: $status")
|
||||
}
|
||||
|
||||
private fun createPool() = SoundPool.Builder()
|
||||
.setMaxStreams(1)
|
||||
.setAudioAttributes(
|
||||
AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||
.build()
|
||||
)
|
||||
.build()
|
||||
|
||||
/** Verify that the device can actually decode the imported file before saving it. */
|
||||
suspend fun validate(file: File): Boolean {
|
||||
val pool = createPool()
|
||||
try {
|
||||
val loaded = CompletableDeferred<Boolean>()
|
||||
pool.setOnLoadCompleteListener { _, _, status -> loaded.complete(status == 0) }
|
||||
if (pool.load(file.absolutePath, 1) == 0) return false
|
||||
return withTimeoutOrNull(10_000) { loaded.await() } == true
|
||||
} finally {
|
||||
pool.release()
|
||||
}
|
||||
|
||||
val afd = context.assets.openFd(SHUTTER_SOUND_PATH)
|
||||
val burstAfd = context.assets.openFd(BURST_SOUND_PATH)
|
||||
soundId = soundPool?.load(afd, 1) ?: -1
|
||||
burstSoundId = soundPool?.load(burstAfd, 1) ?: -1
|
||||
afd.close()
|
||||
|
||||
PLog.d(TAG, "Shutter sound player initialized with SoundPool")
|
||||
} catch (e: Exception) {
|
||||
PLog.e(TAG, "Failed to initialize shutter sound player", e)
|
||||
isLoaded = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放快门音效
|
||||
*/
|
||||
|
||||
private class Sample(val fileName: String?, val id: Int) {
|
||||
val loaded = CompletableDeferred<Boolean>()
|
||||
var ready = false
|
||||
}
|
||||
|
||||
private var single: Sample? = null
|
||||
private var burst: Sample? = null
|
||||
private var streamId = 0
|
||||
private var pool: SoundPool? = createPool().apply {
|
||||
setOnLoadCompleteListener { _, sampleId, status ->
|
||||
synchronized(this@ShutterSoundPlayer) {
|
||||
val sample = listOfNotNull(single, burst).firstOrNull { it.id == sampleId }
|
||||
?: return@setOnLoadCompleteListener
|
||||
sample.ready = status == 0
|
||||
sample.loaded.complete(sample.ready)
|
||||
if (!sample.ready) PLog.e(TAG, "Sound load failed: id=$sampleId, status=$status")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun configure(singleFileName: String?, burstFileName: String?) {
|
||||
val activePool = pool ?: return
|
||||
if (single == null || single?.fileName != singleFileName) {
|
||||
single = replace(activePool, single, singleFileName, "shutter.mp3")
|
||||
}
|
||||
if (burst == null || burst?.fileName != burstFileName) {
|
||||
stopBurst()
|
||||
burst = replace(activePool, burst, burstFileName, "burst.mp3")
|
||||
}
|
||||
}
|
||||
|
||||
private fun replace(activePool: SoundPool, previous: Sample?, fileName: String?, asset: String): Sample {
|
||||
previous?.let {
|
||||
it.loaded.complete(false)
|
||||
activePool.unload(it.id)
|
||||
}
|
||||
val id = try {
|
||||
val file = CaptureSoundRepository.resolve(context, fileName)
|
||||
if (file == null) {
|
||||
context.assets.openFd(asset).use { activePool.load(it, 1) }
|
||||
} else {
|
||||
activePool.load(file.absolutePath, 1)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
PLog.e(TAG, "Cannot load sound: ${fileName ?: asset}", e)
|
||||
0
|
||||
}
|
||||
return Sample(fileName, id).also { if (id == 0) it.loaded.complete(false) }
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun play() {
|
||||
if (soundPool == null || soundId == -1 || !isLoaded) {
|
||||
PLog.w(TAG, "SoundPool not ready: soundPool=$soundPool, soundId=$soundId, isLoaded=$isLoaded")
|
||||
// 如果是因为未初始化或加载失败,尝试重新初始化
|
||||
if (soundPool == null) {
|
||||
initializePlayer()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
// 播放音效:左声道音量, 右声道音量, 优先级, 循环次数(0不循环), 播放速率(1.0正常)
|
||||
soundPool?.play(soundId, 1.0f, 1.0f, 1, 0, 1.0f)
|
||||
} catch (e: Exception) {
|
||||
PLog.e(TAG, "Failed to play shutter sound", e)
|
||||
}
|
||||
playSample(single, loop = false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放连拍快门音效
|
||||
*/
|
||||
@Synchronized
|
||||
fun playBurst() {
|
||||
if (soundPool == null || burstSoundId == -1 || !isLoaded) {
|
||||
PLog.w(TAG, "SoundPool not ready: soundPool=$soundPool, burstSoundId=$soundId, isLoaded=$isLoaded")
|
||||
// 如果是因为未初始化或加载失败,尝试重新初始化
|
||||
if (soundPool == null) {
|
||||
initializePlayer()
|
||||
}
|
||||
return
|
||||
}
|
||||
stopBurst()
|
||||
playSample(burst, loop = true)
|
||||
}
|
||||
|
||||
try {
|
||||
// 播放音效:左声道音量, 右声道音量, 优先级, 循环次数(循环), 播放速率(1.0正常)
|
||||
burstStreamId = soundPool?.play(burstSoundId, 1.0f, 1.0f, 1, -1, 1.0f) ?: -1
|
||||
} catch (e: Exception) {
|
||||
PLog.e(TAG, "Failed to play shutter sound", e)
|
||||
private fun playSample(sample: Sample?, loop: Boolean): Boolean {
|
||||
val activePool = pool ?: return false
|
||||
if (sample?.ready != true) return false
|
||||
streamId = activePool.play(sample.id, 1f, 1f, 1, if (loop) -1 else 0, 1f)
|
||||
return streamId != 0
|
||||
}
|
||||
|
||||
/** A preview plays exactly once, even for the burst sound. */
|
||||
suspend fun preview(isBurst: Boolean): Boolean {
|
||||
val sample = synchronized(this) { if (isBurst) burst else single } ?: return false
|
||||
if (withTimeoutOrNull(10_000) { sample.loaded.await() } != true) return false
|
||||
return synchronized(this) {
|
||||
if (sample !== (if (isBurst) burst else single)) false
|
||||
else playSample(sample, loop = false)
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun stopBurst() {
|
||||
if (soundPool == null || burstStreamId == -1) return
|
||||
try {
|
||||
soundPool?.stop(burstStreamId)
|
||||
} catch (e: Exception) {
|
||||
PLog.e(TAG, "Failed to stop shutter sound", e)
|
||||
}
|
||||
if (streamId != 0) pool?.stop(streamId)
|
||||
streamId = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放资源
|
||||
*/
|
||||
|
||||
@Synchronized
|
||||
fun release() {
|
||||
try {
|
||||
soundPool?.release()
|
||||
soundPool = null
|
||||
soundId = -1
|
||||
burstSoundId = -1
|
||||
isLoaded = false
|
||||
PLog.d(TAG, "Shutter sound player released")
|
||||
} catch (e: Exception) {
|
||||
PLog.e(TAG, "Failed to release shutter sound player", e)
|
||||
}
|
||||
single?.loaded?.complete(false)
|
||||
burst?.loaded?.complete(false)
|
||||
pool?.release()
|
||||
pool = null
|
||||
single = null
|
||||
burst = null
|
||||
streamId = 0
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ import com.hinnka.mycamera.camera.*
|
||||
import com.hinnka.mycamera.data.ContentRepository
|
||||
import com.hinnka.mycamera.data.CameraFeaturePreferencesUpdate
|
||||
import com.hinnka.mycamera.data.CaptureButtonStyle
|
||||
import com.hinnka.mycamera.data.CaptureSoundRepository
|
||||
import com.hinnka.mycamera.R
|
||||
import com.hinnka.mycamera.data.DevelopAnimationStyle
|
||||
import com.hinnka.mycamera.frame.FrameRenderer
|
||||
import com.hinnka.mycamera.data.PreferenceUpdateValue
|
||||
@@ -555,6 +557,11 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
|
||||
// 快门音效播放器
|
||||
private val shutterSoundPlayer = ShutterSoundPlayer(application)
|
||||
private val captureSoundRepository = CaptureSoundRepository(application, userPreferencesRepository)
|
||||
private val _captureSoundImporting = MutableStateFlow(false)
|
||||
val captureSoundImporting = _captureSoundImporting.asStateFlow()
|
||||
private val _captureSoundErrors = MutableSharedFlow<Int>(extraBufferCapacity = 1)
|
||||
val captureSoundErrors = _captureSoundErrors.asSharedFlow()
|
||||
|
||||
// 震动辅助类
|
||||
private val vibrationHelper = VibrationHelper(application)
|
||||
@@ -2090,6 +2097,11 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
)
|
||||
}
|
||||
isShutterSoundEnabled = it.shutterSoundEnabled
|
||||
if (!isShutterSoundEnabled) shutterSoundPlayer.stopBurst()
|
||||
shutterSoundPlayer.configure(
|
||||
it.shutterSoundFileName,
|
||||
it.burstSoundFileName,
|
||||
)
|
||||
isVibrationEnabled = it.vibrationEnabled
|
||||
// 同步降噪等级到相机控制器
|
||||
val currentCameraState = cameraController.state.value
|
||||
@@ -4974,6 +4986,35 @@ class CameraViewModel(application: Application) : AndroidViewModel(application)
|
||||
}
|
||||
}
|
||||
|
||||
fun importCaptureSound(isBurst: Boolean, uri: Uri) {
|
||||
updateCaptureSound(R.string.settings_shutter_sound_import_failed) {
|
||||
captureSoundRepository.import(isBurst, uri)
|
||||
}
|
||||
}
|
||||
|
||||
fun resetCaptureSound(isBurst: Boolean) {
|
||||
updateCaptureSound(R.string.settings_shutter_sound_save_failed) {
|
||||
captureSoundRepository.reset(isBurst)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCaptureSound(errorMessage: Int, operation: suspend () -> Unit) {
|
||||
if (_captureSoundImporting.value) return
|
||||
_captureSoundImporting.value = true
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
operation()
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
PLog.e(TAG, "Cannot update capture sound", e)
|
||||
_captureSoundErrors.emit(errorMessage)
|
||||
} finally {
|
||||
_captureSoundImporting.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否启用拍摄震动
|
||||
*/
|
||||
|
||||
@@ -1223,4 +1223,15 @@
|
||||
<string name="settings_color_palette_description">在編輯頁顯示調色盤,可同時調整影調和飽和度。</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ 畫質調校</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">依實體感光元件尺寸調整融合雜訊估計與降噪。關閉時使用預設成像參數。</string>
|
||||
<string name="settings_shutter_sound_single">單拍聲音</string>
|
||||
<string name="settings_shutter_sound_burst">連拍聲音</string>
|
||||
<string name="settings_shutter_sound_custom_description">匯入長度不超過 3 秒、48 kHz、單聲道或立體聲的音訊片段。連拍音訊會在拍攝期間重複播放。</string>
|
||||
<string name="settings_shutter_sound_default">預設</string>
|
||||
<string name="settings_shutter_sound_choose">選擇音訊</string>
|
||||
<string name="settings_shutter_sound_preview">預覽</string>
|
||||
<string name="settings_shutter_sound_reset">恢復預設</string>
|
||||
<string name="settings_shutter_sound_importing">正在匯入音訊…</string>
|
||||
<string name="settings_shutter_sound_import_failed">無法匯入此音訊。請選擇可播放、長度不超過 3 秒、48 kHz、單聲道或立體聲的片段(上限 10 MB)。</string>
|
||||
<string name="settings_shutter_sound_save_failed">無法儲存聲音設定。請再試一次。</string>
|
||||
<string name="settings_shutter_sound_preview_failed">無法播放此聲音。請重新匯入,或恢復預設。</string>
|
||||
</resources>
|
||||
@@ -313,4 +313,15 @@
|
||||
<string name="recipe_palette_tone">Tonwerte</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ Bildqualitätsoptimierung</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">Rauschschätzung bei der Fusion und Rauschminderung an die physische Sensorgröße anpassen. Wenn deaktiviert, werden die Standardparameter verwendet.</string>
|
||||
<string name="settings_shutter_sound_single">Einzelaufnahmeton</string>
|
||||
<string name="settings_shutter_sound_burst">Serienaufnahmeton</string>
|
||||
<string name="settings_shutter_sound_custom_description">Audioclip mit bis zu 3 Sekunden, 48 kHz, mono oder stereo importieren. Der Serienaufnahmeton wird während der Aufnahme wiederholt.</string>
|
||||
<string name="settings_shutter_sound_default">Standard</string>
|
||||
<string name="settings_shutter_sound_choose">Audio auswählen</string>
|
||||
<string name="settings_shutter_sound_preview">Vorschau</string>
|
||||
<string name="settings_shutter_sound_reset">Standard wiederherstellen</string>
|
||||
<string name="settings_shutter_sound_importing">Audio wird importiert…</string>
|
||||
<string name="settings_shutter_sound_import_failed">Audio kann nicht importiert werden. Wählen Sie einen abspielbaren Clip mit bis zu 3 Sekunden, 48 kHz, mono oder stereo (maximal 10 MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Toneinstellungen können nicht gespeichert werden. Bitte versuchen Sie es erneut.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Ton kann nicht wiedergegeben werden. Bitte importieren Sie ihn erneut oder stellen Sie den Standard wieder her.</string>
|
||||
</resources>
|
||||
@@ -313,4 +313,15 @@
|
||||
<string name="recipe_palette_tone">Rendu tonal</string>
|
||||
<string name="settings_raw_max_quality_tuning">Réglage de la qualité HDR+</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">Adapte l’estimation du bruit de fusion et la réduction du bruit à la taille physique du capteur. Si désactivé, les paramètres par défaut sont utilisés.</string>
|
||||
<string name="settings_shutter_sound_single">Son prise unique</string>
|
||||
<string name="settings_shutter_sound_burst">Son rafale</string>
|
||||
<string name="settings_shutter_sound_custom_description">Importez un clip audio de 3 secondes maximum, en 48 kHz, mono ou stéréo. Le son de rafale se répète pendant la prise de vue.</string>
|
||||
<string name="settings_shutter_sound_default">Par défaut</string>
|
||||
<string name="settings_shutter_sound_choose">Choisir un audio</string>
|
||||
<string name="settings_shutter_sound_preview">Aperçu</string>
|
||||
<string name="settings_shutter_sound_reset">Rétablir la valeur par défaut</string>
|
||||
<string name="settings_shutter_sound_importing">Importation de l’audio…</string>
|
||||
<string name="settings_shutter_sound_import_failed">Impossible d’importer cet audio. Choisissez un clip lisible de 3 secondes maximum, en 48 kHz, mono ou stéréo (10 Mo maximum).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Impossible d’enregistrer les réglages du son. Veuillez réessayer.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Impossible de lire ce son. Veuillez le réimporter ou rétablir la valeur par défaut.</string>
|
||||
</resources>
|
||||
@@ -313,4 +313,15 @@
|
||||
<string name="recipe_palette_tone">Tonalitas</string>
|
||||
<string name="settings_raw_max_quality_tuning">Penyetelan kualitas gambar HDR+</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">Sesuaikan estimasi derau penggabungan dan pengurangan derau dengan ukuran fisik sensor. Saat nonaktif, gunakan parameter gambar bawaan.</string>
|
||||
<string name="settings_shutter_sound_single">Suara satu bidikan</string>
|
||||
<string name="settings_shutter_sound_burst">Suara beruntun</string>
|
||||
<string name="settings_shutter_sound_custom_description">Impor klip audio hingga 3 detik, 48 kHz, mono atau stereo. Audio beruntun akan diulang selama pemotretan.</string>
|
||||
<string name="settings_shutter_sound_default">Default</string>
|
||||
<string name="settings_shutter_sound_choose">Pilih audio</string>
|
||||
<string name="settings_shutter_sound_preview">Pratinjau</string>
|
||||
<string name="settings_shutter_sound_reset">Pulihkan default</string>
|
||||
<string name="settings_shutter_sound_importing">Mengimpor audio…</string>
|
||||
<string name="settings_shutter_sound_import_failed">Audio ini tidak dapat diimpor. Pilih klip yang dapat diputar hingga 3 detik, 48 kHz, mono atau stereo (maksimal 10 MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Setelan suara tidak dapat disimpan. Silakan coba lagi.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Suara ini tidak dapat diputar. Silakan impor ulang atau pulihkan default.</string>
|
||||
</resources>
|
||||
@@ -1121,4 +1121,15 @@
|
||||
<string name="settings_color_palette_description">編集画面にカラーパレットを表示し、階調と彩度を同時に調整できます。</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ 画質調整</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">センサーの物理サイズに合わせて合成時のノイズ推定とノイズ低減を調整します。オフの場合は標準の画像処理パラメータを使用します。</string>
|
||||
<string name="settings_shutter_sound_single">単写音</string>
|
||||
<string name="settings_shutter_sound_burst">連写音</string>
|
||||
<string name="settings_shutter_sound_custom_description">3秒以内、48 kHz、モノラルまたはステレオの音声クリップを読み込みます。連写音は撮影中に繰り返し再生されます。</string>
|
||||
<string name="settings_shutter_sound_default">デフォルト</string>
|
||||
<string name="settings_shutter_sound_choose">音声を選択</string>
|
||||
<string name="settings_shutter_sound_preview">プレビュー</string>
|
||||
<string name="settings_shutter_sound_reset">デフォルトに戻す</string>
|
||||
<string name="settings_shutter_sound_importing">音声を読み込み中…</string>
|
||||
<string name="settings_shutter_sound_import_failed">この音声を読み込めません。3秒以内、48 kHz、モノラルまたはステレオで、再生可能なクリップを選択してください(最大10 MB)。</string>
|
||||
<string name="settings_shutter_sound_save_failed">サウンド設定を保存できません。もう一度お試しください。</string>
|
||||
<string name="settings_shutter_sound_preview_failed">この音声を再生できません。もう一度読み込むか、デフォルトに戻してください。</string>
|
||||
</resources>
|
||||
@@ -314,4 +314,15 @@
|
||||
<string name="recipe_palette_tone">명암</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ 화질 조정</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">센서의 물리적 크기에 맞춰 합성 노이즈 추정과 노이즈 감소를 조정합니다. 끄면 기본 이미지 처리 매개변수를 사용합니다.</string>
|
||||
<string name="settings_shutter_sound_single">단일 촬영음</string>
|
||||
<string name="settings_shutter_sound_burst">연사 촬영음</string>
|
||||
<string name="settings_shutter_sound_custom_description">최대 3초, 48kHz, 모노 또는 스테레오 오디오 클립을 가져옵니다. 연사 오디오는 촬영 중 반복 재생됩니다.</string>
|
||||
<string name="settings_shutter_sound_default">기본값</string>
|
||||
<string name="settings_shutter_sound_choose">오디오 선택</string>
|
||||
<string name="settings_shutter_sound_preview">미리 듣기</string>
|
||||
<string name="settings_shutter_sound_reset">기본값 복원</string>
|
||||
<string name="settings_shutter_sound_importing">오디오 가져오는 중…</string>
|
||||
<string name="settings_shutter_sound_import_failed">이 오디오를 가져올 수 없습니다. 최대 3초, 48kHz, 모노 또는 스테레오이며 재생 가능한 클립을 선택하세요(최대 10MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">사운드 설정을 저장할 수 없습니다. 다시 시도해 주세요.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">이 사운드를 재생할 수 없습니다. 다시 가져오거나 기본값을 복원해 주세요.</string>
|
||||
</resources>
|
||||
@@ -314,4 +314,15 @@
|
||||
<string name="recipe_palette_tone">Equilíbrio tonal</string>
|
||||
<string name="settings_raw_max_quality_tuning">Ajuste de qualidade HDR+</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">Ajusta a estimativa de ruído da fusão e a redução de ruído ao tamanho físico do sensor. Quando desativado, usa os parâmetros de imagem padrão.</string>
|
||||
<string name="settings_shutter_sound_single">Som de foto única</string>
|
||||
<string name="settings_shutter_sound_burst">Som de disparo contínuo</string>
|
||||
<string name="settings_shutter_sound_custom_description">Importe um clipe de áudio de até 3 segundos, 48 kHz, mono ou estéreo. O áudio do disparo contínuo se repete durante a captura.</string>
|
||||
<string name="settings_shutter_sound_default">Padrão</string>
|
||||
<string name="settings_shutter_sound_choose">Escolher áudio</string>
|
||||
<string name="settings_shutter_sound_preview">Prévia</string>
|
||||
<string name="settings_shutter_sound_reset">Restaurar padrão</string>
|
||||
<string name="settings_shutter_sound_importing">Importando áudio…</string>
|
||||
<string name="settings_shutter_sound_import_failed">Não é possível importar este áudio. Escolha um clipe reproduzível de até 3 segundos, 48 kHz, mono ou estéreo (máximo de 10 MB).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Não é possível salvar as configurações de som. Tente novamente.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Não é possível reproduzir este som. Importe-o novamente ou restaure o padrão.</string>
|
||||
</resources>
|
||||
@@ -931,4 +931,15 @@
|
||||
<string name="recipe_palette_tone">โทนแสง</string>
|
||||
<string name="settings_raw_max_quality_tuning">ปรับคุณภาพภาพ HDR+</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">ปรับการประเมินสัญญาณรบกวนในการรวมภาพและการลดสัญญาณรบกวนตามขนาดจริงของเซ็นเซอร์ เมื่อปิดจะใช้พารามิเตอร์ภาพเริ่มต้น</string>
|
||||
<string name="settings_shutter_sound_single">เสียงถ่ายภาพเดี่ยว</string>
|
||||
<string name="settings_shutter_sound_burst">เสียงถ่ายภาพต่อเนื่อง</string>
|
||||
<string name="settings_shutter_sound_custom_description">นำเข้าคลิปเสียงความยาวไม่เกิน 3 วินาที, 48 kHz, โมโนหรือสเตอริโอ เสียงถ่ายภาพต่อเนื่องจะเล่นซ้ำขณะถ่ายภาพ</string>
|
||||
<string name="settings_shutter_sound_default">ค่าเริ่มต้น</string>
|
||||
<string name="settings_shutter_sound_choose">เลือกเสียง</string>
|
||||
<string name="settings_shutter_sound_preview">ดูตัวอย่าง</string>
|
||||
<string name="settings_shutter_sound_reset">คืนค่าเริ่มต้น</string>
|
||||
<string name="settings_shutter_sound_importing">กำลังนำเข้าเสียง…</string>
|
||||
<string name="settings_shutter_sound_import_failed">นำเข้าเสียงนี้ไม่ได้ โปรดเลือกคลิปที่เล่นได้ ความยาวไม่เกิน 3 วินาที, 48 kHz, โมโนหรือสเตอริโอ (ขนาดสูงสุด 10 MB)</string>
|
||||
<string name="settings_shutter_sound_save_failed">บันทึกการตั้งค่าเสียงไม่ได้ โปรดลองอีกครั้ง</string>
|
||||
<string name="settings_shutter_sound_preview_failed">เล่นเสียงนี้ไม่ได้ โปรดนำเข้าอีกครั้งหรือคืนค่าเริ่มต้น</string>
|
||||
</resources>
|
||||
@@ -1244,4 +1244,15 @@
|
||||
<string name="settings_color_palette_description">在编辑页显示调色盘,可同时调整影调和饱和度。</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ 画质调优</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">按物理传感器尺寸调整融合噪声估计和降噪。关闭时使用默认成像参数。</string>
|
||||
<string name="settings_shutter_sound_single">单拍声音</string>
|
||||
<string name="settings_shutter_sound_burst">连拍声音</string>
|
||||
<string name="settings_shutter_sound_custom_description">导入时长不超过 3 秒、48 kHz、单声道或立体声的音频片段。连拍音频会在拍摄过程中重复播放。</string>
|
||||
<string name="settings_shutter_sound_default">默认</string>
|
||||
<string name="settings_shutter_sound_choose">选择音频</string>
|
||||
<string name="settings_shutter_sound_preview">预览</string>
|
||||
<string name="settings_shutter_sound_reset">恢复默认</string>
|
||||
<string name="settings_shutter_sound_importing">正在导入音频…</string>
|
||||
<string name="settings_shutter_sound_import_failed">无法导入此音频。请选择可播放、时长不超过 3 秒、48 kHz、单声道或立体声的片段(最大 10 MB)。</string>
|
||||
<string name="settings_shutter_sound_save_failed">无法保存声音设置,请重试。</string>
|
||||
<string name="settings_shutter_sound_preview_failed">无法播放此声音。请重新导入,或恢复默认设置。</string>
|
||||
</resources>
|
||||
@@ -1219,4 +1219,15 @@
|
||||
<string name="settings_color_palette_description">在編輯頁顯示調色盤,可同時調整影調和飽和度。</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ 畫質調校</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">按實體感光元件尺寸調整融合雜訊估計與降噪。關閉時使用預設成像參數。</string>
|
||||
<string name="settings_shutter_sound_single">單拍聲音</string>
|
||||
<string name="settings_shutter_sound_burst">連拍聲音</string>
|
||||
<string name="settings_shutter_sound_custom_description">匯入長度不超過 3 秒、48 kHz、單聲道或立體聲的音訊片段。連拍音訊會在拍攝期間重複播放。</string>
|
||||
<string name="settings_shutter_sound_default">預設</string>
|
||||
<string name="settings_shutter_sound_choose">選擇音訊</string>
|
||||
<string name="settings_shutter_sound_preview">預覽</string>
|
||||
<string name="settings_shutter_sound_reset">恢復預設</string>
|
||||
<string name="settings_shutter_sound_importing">正在匯入音訊…</string>
|
||||
<string name="settings_shutter_sound_import_failed">無法匯入此音訊。請選擇可播放、長度不超過 3 秒、48 kHz、單聲道或立體聲的片段(上限 10 MB)。</string>
|
||||
<string name="settings_shutter_sound_save_failed">無法儲存聲音設定。請再試一次。</string>
|
||||
<string name="settings_shutter_sound_preview_failed">無法播放此聲音。請重新匯入,或恢復預設。</string>
|
||||
</resources>
|
||||
@@ -1223,4 +1223,15 @@
|
||||
<string name="settings_color_palette_description">在編輯頁顯示調色盤,可同時調整影調和飽和度。</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ 畫質調校</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">依實體感光元件尺寸調整融合雜訊估計與降噪。關閉時使用預設成像參數。</string>
|
||||
<string name="settings_shutter_sound_single">單拍聲音</string>
|
||||
<string name="settings_shutter_sound_burst">連拍聲音</string>
|
||||
<string name="settings_shutter_sound_custom_description">匯入長度不超過 3 秒、48 kHz、單聲道或立體聲的音訊片段。連拍音訊會在拍攝期間重複播放。</string>
|
||||
<string name="settings_shutter_sound_default">預設</string>
|
||||
<string name="settings_shutter_sound_choose">選擇音訊</string>
|
||||
<string name="settings_shutter_sound_preview">預覽</string>
|
||||
<string name="settings_shutter_sound_reset">恢復預設</string>
|
||||
<string name="settings_shutter_sound_importing">正在匯入音訊…</string>
|
||||
<string name="settings_shutter_sound_import_failed">無法匯入此音訊。請選擇可播放、長度不超過 3 秒、48 kHz、單聲道或立體聲的片段(上限 10 MB)。</string>
|
||||
<string name="settings_shutter_sound_save_failed">無法儲存聲音設定。請再試一次。</string>
|
||||
<string name="settings_shutter_sound_preview_failed">無法播放此聲音。請重新匯入,或恢復預設。</string>
|
||||
</resources>
|
||||
@@ -1268,4 +1268,15 @@
|
||||
<string name="settings_color_palette_description">Show the color palette in the editor to adjust tonality and saturation together.</string>
|
||||
<string name="settings_raw_max_quality_tuning">HDR+ image quality tuning</string>
|
||||
<string name="settings_raw_max_quality_tuning_description">Adjust fusion noise estimates and denoising to the physical sensor size. When off, use default imaging parameters.</string>
|
||||
<string name="settings_shutter_sound_single">Single-shot sound</string>
|
||||
<string name="settings_shutter_sound_burst">Burst sound</string>
|
||||
<string name="settings_shutter_sound_custom_description">Import an audio clip up to 3 seconds, 48 kHz, mono or stereo. Burst audio repeats while shooting.</string>
|
||||
<string name="settings_shutter_sound_default">Default</string>
|
||||
<string name="settings_shutter_sound_choose">Choose audio</string>
|
||||
<string name="settings_shutter_sound_preview">Preview</string>
|
||||
<string name="settings_shutter_sound_reset">Restore default</string>
|
||||
<string name="settings_shutter_sound_importing">Importing audio…</string>
|
||||
<string name="settings_shutter_sound_import_failed">Cannot import this audio. Choose a playable clip up to 3 seconds, 48 kHz, mono or stereo (10 MB maximum).</string>
|
||||
<string name="settings_shutter_sound_save_failed">Cannot save sound settings. Please try again.</string>
|
||||
<string name="settings_shutter_sound_preview_failed">Cannot play this sound. Please import it again or restore the default.</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user