{"id":32149374,"url":"https://github.com/emergenceai/kotlin_speech_features","last_synced_at":"2025-12-11T22:54:44.174Z","repository":{"id":59400720,"uuid":"537006653","full_name":"EmergenceAI/kotlin_speech_features","owner":"EmergenceAI","description":"This library provides common speech features for ASR including MFCCs and filterbank energies for Android and iOS.","archived":false,"fork":false,"pushed_at":"2022-09-20T07:12:41.000Z","size":8480,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-21T09:55:20.662Z","etag":null,"topics":["android","feature-extraction","ios","kotlin","speech-feature-extraction","speech-features","speech-processing"],"latest_commit_sha":null,"homepage":"https://merlynmind.github.io/kotlin_speech_features/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EmergenceAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-15T12:02:16.000Z","updated_at":"2025-09-28T11:09:30.000Z","dependencies_parsed_at":"2022-09-16T10:11:00.609Z","dependency_job_id":null,"html_url":"https://github.com/EmergenceAI/kotlin_speech_features","commit_stats":null,"previous_names":["emergenceai/kotlin_speech_features"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/EmergenceAI/kotlin_speech_features","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmergenceAI%2Fkotlin_speech_features","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmergenceAI%2Fkotlin_speech_features/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmergenceAI%2Fkotlin_speech_features/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmergenceAI%2Fkotlin_speech_features/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EmergenceAI","download_url":"https://codeload.github.com/EmergenceAI/kotlin_speech_features/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmergenceAI%2Fkotlin_speech_features/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280240309,"owners_count":26296527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","feature-extraction","ios","kotlin","speech-feature-extraction","speech-features","speech-processing"],"created_at":"2025-10-21T09:55:37.515Z","updated_at":"2025-10-21T09:55:38.486Z","avatar_url":"https://github.com/EmergenceAI.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n\n\u003ch1 align=\"center\"\u003e\nKotlin Speech Features\n\u003c/h1\u003e\n\n\n\u003cimg src=\"https://img.shields.io/badge/Kotlin-1.7.10-blue?style=for-the-badge\u0026logo=kotlin\"\u003e\u003c/img\u003e \u003cimg src=\"https://img.shields.io/badge/license-MIT-chlorine?style=for-the-badge\"\u003e\u003c/img\u003e  \u003ca href=\"https://jitpack.io/#merlynmind/kotlin_speech_features\"\u003e\u003cimg src=\"https://img.shields.io/jitpack/version/com.github.MerlynMind/kotlin_speech_features?style=for-the-badge\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n\n\n![GitHub forks](https://img.shields.io/github/forks/MerlynMind/kotlin_speech_features?style=for-the-badge)\n![GitHub issues](https://img.shields.io/github/issues/MerlynMind/kotlin_speech_features?style=for-the-badge)\n![GitHub Stars](https://img.shields.io/github/stars/MerlynMind/kotlin_speech_features?style=for-the-badge)\n\n\n\u003c!-- \u003cimg style=\"background-color: white;\" src=\"https://assets.website-files.com/627028e6193b2d840a066eab/627028e6193b2d86cd066ee0_MM%20Logo.svg\" loading=\"lazy\" \u003e --\u003e\n\n---\n\n\u003ch3 align=\"left\"\u003eQuick Links\u003c/h3\u003e\n\n\n\u003ca href=\"https://merlyn.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/home-ff7300?style=for-the-badge\"\u003e\u003c/a\u003e\t\u0026nbsp;\n\u003ca href=\"https://merlynmind.github.io/kotlin_speech_features/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Docs-2196F3?style=for-the-badge\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n\n\n# 📒 Introduction\n\u003cp align=\"center\"\u003e\nThis library is a complete port of \u003ca href=\"https://github.com/jameslyons/python_speech_features\"\u003e python_speech_features\u003c/a\u003e in pure Kotlin available for Android and iOS projects. \u003c/p\u003e\n\u003cp align=\"center\"\u003e\nIt provides common speech features for Automated speech recognition (ASR) including MFCCs and filterbank energies.\n\u003cbr\u003eTo know more about MFCCs \u003ca href=\"http://www.practicalcryptography.com/miscellaneous/machine-learning/guide-mel-frequency-cepstral-coefficients-mfccs/\"\u003eread more\u003c/a\u003e.\n\n### Features\n\n- [Mel Frequency Cepstral Coefficients (mfcc)](https://merlynmind.github.io/kotlin_speech_features/-kotlin%20-speech%20-features/org.merlyn.kotlinspeechfeatures/-speech-features/mfcc.html)\n- [Filterbank Energies (fbank)](https://merlynmind.github.io/kotlin_speech_features/-kotlin%20-speech%20-features/org.merlyn.kotlinspeechfeatures/-speech-features/fbank.html)\n- [Log Filterbank Energies (logfbank)](https://merlynmind.github.io/kotlin_speech_features/-kotlin%20-speech%20-features/org.merlyn.kotlinspeechfeatures/-speech-features/logfbank.html)\n- [Spectral Subband Centroids (ssc)](https://merlynmind.github.io/kotlin_speech_features/-kotlin%20-speech%20-features/org.merlyn.kotlinspeechfeatures/-speech-features/ssc.html)\n\n\u003c/p\u003e\n\n\n# 🙋 How to use\n\nWe support multiple platforms using Kotlin multiplatform.\n\n\u003cdetails\u003e\n\u003csummary\u003e Android \u003c/summary\u003e\n\n## Integration\nAdd jitpack.io to your project's repositories:\n\n```gradle\nallProjects {\n  repositories {\n    google()\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\nAdd the dependency:\n\n```gradle\ndependencies {\n    implementation \"com.github.MerlynMind:kotlin_speech_features:${version}\"\n}\n```\n\n\n## Example implementation\n\nA sample app is included in this repo to help understand the implementation.\n\n1. Convert your audio signal in the form of a float array. (A demo provided in the sample app)\n2. Initialize speech features\n\t```kotlin\n\tprivate val speechFeatures = SpeechFeatures()\n\t```\n3. Perform any of the 4 operations:\n\t```kotlin\n\tval result = speechFeatures.mfcc(MathUtils.normalize(wav), nFilt = 64)\n\tval result = speechFeatures.fbank(MathUtils.normalize(wav), nFilt = 64)\n\tval result = speechFeatures.logfbank(MathUtils.normalize(wav), nFilt = 64)\n\tval result = speechFeatures.ssc(MathUtils.normalize(wav), nFilt = 64)\n\t```\n4. The result will contain metrices with the expected features. Pass in these features for further processes (e.g. classification, speech recognition).\n\n  ---\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\t\u003csummary\u003e iOS \u003c/summary\u003e\n\n\n## Integration\n\n1. In XCode, go to `File \u003e Add Packages...`\n2. Paste in the URL of this repo in the search box\n3. Select the package found\n4. Click `Add Package` button\n\n\n## Example implementation\n\nA sample app is included in this repo to help understand the implementation.\n\n1. Convert your audio signal in the form of an `KotlinIntArray` and normalize it.\n   ```swift\n   import KotlinSpeechFeatures\n\n   let signal = [Int](1...1000) // Example signal\n   let normalized = MathUtils.Companion.init().normalize(sig: toKotlinIntArray(arr: signal))\n\n   func toKotlinIntArray(arr: [Int]) -\u003e KotlinIntArray {\n       let result = KotlinIntArray(size: Int32(arr.capacity))\n       for i in 0...(arr.count-1) {\n           result.set(index: Int32(i), value: Int32(arr[i]))\n       }\n       return result\n   }\n   ```\n2. Initialize speech features\n   ```swift\n   let speechFeatures = SpeechFeatures()\n   ```\n3. Perform any of the 4 operations:\n   ```swift\n   let result = speechFeatures.mfcc(signal: normalized, sampleRate: 16000, winLen: 0.025, winStep: 0.01, numCep: 13, nFilt: 64, nfft: 512, lowFreq: 0, highFreq: ni;, preemph: 0.97, ceplifter: 22, appendEnergy: true, winFunc: nil)\n   let result = speechFeatures.fbank(signal: normalized, sampleRate: 16000, winLen: 0.025, winStep: 0.01, nFilt: 64, nfft: 512, lowFreq: 0, highFreq: nil, preemph: 0.97, winFunc: nil)\n   let result = speechFeatures.logfbank(signal: normalized, sampleRate: 16000, winLen: 0.025, winStep: 0.01, nFilt: 64, nfft: 512, lowFreq: 0, highFreq: nil, preemph: 0.97, winFunc: nil)\n   let result = speechFeatures.ssc(signal: normalized, sampleRate: 16000, winLen: 0.025, winStep: 0.01, nFilt: 64, nfft: 512, lowFreq: 0, highFreq: nil, preemph: 0.97, winFunc: nil)\n   ```\n4. The result will contain metrices with the expected features. Pass in these features for further processes (e.g. classification, speech recognition).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\t\u003csummary\u003e JavaScript \u003c/summary\u003e\n\n  ```\n  Coming soon...\n  ```\n\n\u003c/details\u003e\n\n\n\n\n# ✍️ Contributing\nInterested in contributing to the library? Thank you so much for your interest!\nWe are always looking for improvements to the project and contributions from open-source developers are greatly appreciated.\n\n1. Clone repo and create a new branch:\n```\ngit checkout https://github.com/merlynmind/kotlin_speech_features -b name_for_new_branch\n```\n2. Make changes and test\n3. Submit Pull Request with comprehensive description of changes\n\n# 🌟 Spread the word!\nIf you want to say thank you and/or support active development of this library:\n\n- Add a GitHub Star to the project!\n- Tweet about the project on your Twitter!\nTag @MerlynMind and/or #heyMerlnyn\n\nThank you so much for your interest in growing the reach of our library!\n\n\n# 🧡 Credits\n- [Arjun Sunil](https://github.com/arjun921) - Original Author of kotlin speech features\n- [Raquib-Ul Alam](https://github.com/alamkanak) - For major refactoring and making the code presentable\n- [Rob Smith](https://github.com/robmsmt) - For Mentoring and helping us to navigate through the task\n\n# 📝 References\n\n- Original library - [Python Speech Features](https://github.com/jameslyons/python_speech_features)\n- Reference Library - [C Speech Features](https://github.com/Cwiiis/c_speech_features)\n- Sample english.wav was obtained from\n```\nwget http://voyager.jpl.nasa.gov/spacecraft/audio/english.au\nsox english.au -e signed-integer english.wav\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femergenceai%2Fkotlin_speech_features","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femergenceai%2Fkotlin_speech_features","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femergenceai%2Fkotlin_speech_features/lists"}