A sample app is included in this repo to help understand the implementation.
Convert your audio signal in the form of a float array. (A demo provided in the sample app)
Initialize speech features
private val speechFeatures = SpeechFeatures()
Perform any of the 4 operations:
val result = speechFeatures.mfcc(MathUtils.normalize(wav), nFilt = 64)
val result = speechFeatures.fbank(MathUtils.normalize(wav), nFilt = 64)
val result = speechFeatures.logfbank(MathUtils.normalize(wav), nFilt = 64)
val result = speechFeatures.ssc(MathUtils.normalize(wav), nFilt = 64)
The result will contain metrices with the expected features. Pass in these features for further processes (e.g. classification, speech recognition).
iOS
Integration
In XCode, go to File > Add Packages...
Paste in the URL of this repo in the search box
Select the package found
Click Add Package button
Example implementation
A sample app is included in this repo to help understand the implementation.
Convert your audio signal in the form of an KotlinIntArray and normalize it.
import KotlinSpeechFeatures
let signal = [Int](1...1000) // Example signal
let normalized = MathUtils.Companion.init().normalize(sig: toKotlinIntArray(arr: signal))
func toKotlinIntArray(arr: [Int]) -> KotlinIntArray {
let result = KotlinIntArray(size: Int32(arr.capacity))
for i in 0...(arr.count-1) {
result.set(index: Int32(i), value: Int32(arr[i]))
}
return result
}
The result will contain metrices with the expected features. Pass in these features for further processes (e.g. classification, speech recognition).
JavaScript
Coming soon...
✍️ Contributing
Interested in contributing to the library? Thank you so much for your interest!
We are always looking for improvements to the project and contributions from open-source developers are greatly appreciated.
Kotlin Speech Features
Quick Links
📒 Introduction
This library is a complete port of python_speech_features in pure Kotlin available for Android and iOS projects.
It provides common speech features for Automated speech recognition (ASR) including MFCCs and filterbank energies.
To know more about MFCCs read more.
Features
🙋 How to use
We support multiple platforms using Kotlin multiplatform.
Android
Integration
Add jitpack.io to your project’s repositories:
Add the dependency:
Example implementation
A sample app is included in this repo to help understand the implementation.
iOS
Integration
File > Add Packages...
Add Package
buttonExample implementation
A sample app is included in this repo to help understand the implementation.
Convert your audio signal in the form of an
KotlinIntArray
and normalize it.Initialize speech features
Perform any of the 4 operations:
The result will contain metrices with the expected features. Pass in these features for further processes (e.g. classification, speech recognition).
JavaScript
✍️ Contributing
Interested in contributing to the library? Thank you so much for your interest! We are always looking for improvements to the project and contributions from open-source developers are greatly appreciated.
🌟 Spread the word!
If you want to say thank you and/or support active development of this library:
Thank you so much for your interest in growing the reach of our library!
🧡 Credits
📝 References