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

Codecs: Set OGG/Opus as the default codec #35

Merged
merged 1 commit into from
May 27, 2022
Merged
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ BCR is a simple Android call recording app for rooted devices or devices running

* Supports Android 9 through 13
* Supports compressed output in various formats:
* FLAC - Lossless, larger files (default)
* OGG/Opus - Lossy, smallest files, Android 10+ only
* M4A/AAC - Lossy, smaller files
* OGG/Opus - Lossy, smallest files, default on Android 10+
* M4A/AAC - Lossy, smaller files, default on Android 9
* FLAC - Lossless, larger files
* Records at the device's native sample rate
* Supports Android's Storage Access Framework (can record to SD cards, USB devices, etc.)
* Quick settings toggle
Expand Down
10 changes: 2 additions & 8 deletions app/src/main/java/com/chiller3/bcr/codec/Codecs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.content.Context
import com.chiller3.bcr.Preferences

object Codecs {
val all: Array<Codec> = arrayOf(FlacCodec, OpusCodec, AacCodec)
val default: Codec = all.first()
val all: Array<Codec> = arrayOf(OpusCodec, AacCodec, FlacCodec)
val default: Codec = all.first { it.supported }

/** Find output codec by name. */
fun getByName(name: String): Codec? = all.find { it.name == name }
Expand All @@ -30,10 +30,4 @@ object Codecs {

return Pair(codec, param)
}

/** Save the selected codec and its parameter to the preferences. */
fun saveToPreferences(context: Context, codec: Codec, param: UInt?) {
Preferences.setCodecName(context, codec.name)
Preferences.setCodecParam(context, codec.name, param)
}
}