Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: disable audio filter #3097

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.sp
import com.wire.android.BuildConfig
import com.wire.android.R
import com.wire.android.media.audiomessage.AudioMediaPlayingState
import com.wire.android.media.audiomessage.AudioState
Expand Down Expand Up @@ -154,11 +155,11 @@ fun RecordAudioButtonSend(
applyAudioFilterState: Boolean,
audioState: AudioState,
onClick: () -> Unit,
modifier: Modifier,
outputFile: File?,
onPlayAudio: () -> Unit,
onSliderPositionChange: (Int) -> Unit,
applyAudioFilterClick: (Boolean) -> Unit
applyAudioFilterClick: (Boolean) -> Unit,
modifier: Modifier = Modifier
) {
RecordAudioButton(
onClick = onClick,
Expand Down Expand Up @@ -188,15 +189,15 @@ fun RecordAudioButtonSend(
@Composable
private fun RecordAudioButton(
onClick: () -> Unit,
modifier: Modifier,
topContent: @Composable () -> Unit,
@DrawableRes iconResId: Int,
@StringRes contentDescription: Int,
buttonColor: Color,
@StringRes bottomText: Int,
buttonState: WireButtonState = WireButtonState.Default,
applyAudioFilterState: Boolean,
applyAudioFilterClick: (Boolean) -> Unit,
modifier: Modifier = Modifier,
buttonState: WireButtonState = WireButtonState.Default,
isAudioFilterEnabled: Boolean = true
) {
Column(
Expand Down Expand Up @@ -232,19 +233,21 @@ private fun RecordAudioButton(
)

Spacer(modifier = Modifier.height(dimensions().spacing40x))
Row(
verticalAlignment = Alignment.CenterVertically
) {
Checkbox(
enabled = isAudioFilterEnabled,
checked = applyAudioFilterState,
onCheckedChange = applyAudioFilterClick
)
Text(
text = stringResource(id = R.string.record_audio_apply_filter_label),
style = MaterialTheme.wireTypography.body01,
color = if (isAudioFilterEnabled) Color.Unspecified else colorsScheme().checkboxTextDisabled
)
if (BuildConfig.AUDIO_FILTER_ENABLED) {
Row(
verticalAlignment = Alignment.CenterVertically
) {
Checkbox(
enabled = isAudioFilterEnabled,
checked = applyAudioFilterState,
onCheckedChange = applyAudioFilterClick
)
Text(
text = stringResource(id = R.string.record_audio_apply_filter_label),
style = MaterialTheme.wireTypography.body01,
color = if (isAudioFilterEnabled) Color.Unspecified else colorsScheme().checkboxTextDisabled
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.runtime.setValue
import androidx.core.net.toUri
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wire.android.BuildConfig
import com.wire.android.appLogger
import com.wire.android.datastore.GlobalDataStore
import com.wire.android.media.audiomessage.AudioMediaPlayingState
Expand Down Expand Up @@ -174,12 +175,14 @@ class RecordAudioViewModel @Inject constructor(
}
audioMediaRecorder.release()

if (state.originalOutputFile != null && state.effectsOutputFile != null) {
generateAudioFileWithEffects(
context = context,
originalFilePath = state.originalOutputFile!!.path,
effectsFilePath = state.effectsOutputFile!!.path
)
if (state.originalOutputFile != null) {
if (BuildConfig.AUDIO_FILTER_ENABLED && state.effectsOutputFile != null) {
generateAudioFileWithEffects(
context = context,
originalFilePath = state.originalOutputFile!!.path,
effectsFilePath = state.effectsOutputFile!!.path
)
}

state = state.copy(
buttonState = RecordAudioButtonState.READY_TO_SEND,
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/customization/FeatureConfigs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ enum class FeatureConfigs(val value: String, val configType: ConfigType) {
MAX_REMOTE_SEARCH_RESULT_COUNT("max_remote_search_result_count", ConfigType.INT),
LIMIT_TEAM_MEMBERS_FETCH_DURING_SLOW_SYNC("limit_team_members_fetch_during_slow_sync", ConfigType.INT),

AUDIO_FILTER_ENABLED("audio_filter_enabled", ConfigType.BOOLEAN),
/**
* Anonymous Analytics
*/
Expand Down
9 changes: 6 additions & 3 deletions default.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"encrypt_proteus_storage": true,
"analytics_enabled": true,
"analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438",
"analytics_server_url": "https://countly.wire.com/"
"analytics_server_url": "https://countly.wire.com/",
"audio_filter_enabled": true
},
"staging": {
"application_id": "com.waz.zclient.dev",
Expand All @@ -55,7 +56,8 @@
"encrypt_proteus_storage": true,
"analytics_enabled": true,
"analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438",
"analytics_server_url": "https://countly.wire.com/"
"analytics_server_url": "https://countly.wire.com/",
"audio_filter_enabled": true
},
"beta": {
"application_id": "com.wire.android.internal",
Expand Down Expand Up @@ -138,5 +140,6 @@
"team_app_lock": false,
"team_app_lock_timeout": 60,
"max_remote_search_result_count": 30,
"limit_team_members_fetch_during_slow_sync": 2000
"limit_team_members_fetch_during_slow_sync": 2000,
"audio_filter_enabled": false
}
Loading