Classification of sounds using android mobile phone and the YAMNet ML model

val floatsForInference = FloatArray(arrayListShorts.size)
for ((index, value) in arrayListShorts.withIndex()) {
floatsForInference[index] = (value / 32768F)
}
val arrayMeanScores = FloatArray(521) { 0f }
for (i in 0 until 521) {
// Find the average of the 4 arrays at axis = 0
arrayMeanScores[i] = arrayListOf(
arrayScores[0][i],
arrayScores[1][i],
arrayScores[2][i],
arrayScores[3][i]
).average().toFloat()
}
implementation('org.tensorflow:tensorflow-lite-support:0.0.0-nightly')
val labels = FileUtil.loadLabels(context, "classes.txt")
Speech
Child speech, kid speaking
Conversation
Narration, monologue
Babbling
Speech synthesizer
Shout
Bellow
Whoop
Yell
Children shouting
Screaming
Whispering
Laughter
Baby laughter
Giggle
Snicker
Belly laugh
………………………

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store