all: reformat
This commit is contained in:
parent
5efdfb6aac
commit
3a04bef074
1 changed files with 10 additions and 8 deletions
|
|
@ -20,7 +20,6 @@ package org.oxycblt.auxio.music.metadata
|
||||||
|
|
||||||
import androidx.core.text.isDigitsOnly
|
import androidx.core.text.isDigitsOnly
|
||||||
import androidx.media3.common.MediaItem
|
import androidx.media3.common.MediaItem
|
||||||
import androidx.media3.common.MimeTypes
|
|
||||||
import androidx.media3.exoplayer.MetadataRetriever
|
import androidx.media3.exoplayer.MetadataRetriever
|
||||||
import androidx.media3.exoplayer.source.MediaSource
|
import androidx.media3.exoplayer.source.MediaSource
|
||||||
import androidx.media3.exoplayer.source.TrackGroupArray
|
import androidx.media3.exoplayer.source.TrackGroupArray
|
||||||
|
|
@ -99,10 +98,9 @@ private class TagWorkerImpl(
|
||||||
populateWithId3v2(textTags.id3v2)
|
populateWithId3v2(textTags.id3v2)
|
||||||
populateWithVorbis(textTags.vorbis)
|
populateWithVorbis(textTags.vorbis)
|
||||||
|
|
||||||
|
|
||||||
// OPUS base gain interpretation code: This is likely not needed, as the media player
|
// OPUS base gain interpretation code: This is likely not needed, as the media player
|
||||||
// should be using the base gain already. Uncomment if that's not the case.
|
// should be using the base gain already. Uncomment if that's not the case.
|
||||||
//if (format.sampleMimeType == MimeTypes.AUDIO_OPUS
|
// if (format.sampleMimeType == MimeTypes.AUDIO_OPUS
|
||||||
// && format.initializationData.isNotEmpty()
|
// && format.initializationData.isNotEmpty()
|
||||||
// && format.initializationData[0].size >= 18) {
|
// && format.initializationData[0].size >= 18) {
|
||||||
// val header = format.initializationData[0]
|
// val header = format.initializationData[0]
|
||||||
|
|
@ -119,7 +117,7 @@ private class TagWorkerImpl(
|
||||||
// } else {
|
// } else {
|
||||||
// logD("Ignoring opus base gain")
|
// logD("Ignoring opus base gain")
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
} else {
|
} else {
|
||||||
logD("No metadata could be extracted for ${rawSong.name}")
|
logD("No metadata could be extracted for ${rawSong.name}")
|
||||||
}
|
}
|
||||||
|
|
@ -331,10 +329,14 @@ private class TagWorkerImpl(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun List<String>.parseR128Adjustment() =
|
private fun List<String>.parseR128Adjustment() =
|
||||||
first().replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "").toFloatOrNull()?.nonZeroOrNull()?.run {
|
first()
|
||||||
// Convert to fixed-point and adjust to LUFS 18 to match the ReplayGain scale
|
.replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "")
|
||||||
this / 256f + 5
|
.toFloatOrNull()
|
||||||
}
|
?.nonZeroOrNull()
|
||||||
|
?.run {
|
||||||
|
// Convert to fixed-point and adjust to LUFS 18 to match the ReplayGain scale
|
||||||
|
this / 256f + 5
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a ReplayGain adjustment into a float value.
|
* Parse a ReplayGain adjustment into a float value.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue