{"id":24903898,"url":"https://github.com/alexruperez/speechrecognizerbutton","last_synced_at":"2025-09-02T11:39:48.568Z","repository":{"id":62455849,"uuid":"122995414","full_name":"alexruperez/SpeechRecognizerButton","owner":"alexruperez","description":"UIButton subclass with push to talk recording, speech recognition and Siri-style waveform view.","archived":false,"fork":false,"pushed_at":"2019-08-15T14:42:37.000Z","size":594,"stargazers_count":183,"open_issues_count":2,"forks_count":35,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-26T21:30:16.140Z","etag":null,"topics":["carthage","ios","push-to-talk","record-audio","siri","speech-recognition","speech-to-text","swift","uibutton","uibutton-subclass","waveform"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/alexruperez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-02-26T16:16:06.000Z","updated_at":"2025-07-01T09:59:26.000Z","dependencies_parsed_at":"2022-11-02T00:00:43.045Z","dependency_job_id":null,"html_url":"https://github.com/alexruperez/SpeechRecognizerButton","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/alexruperez/SpeechRecognizerButton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FSpeechRecognizerButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FSpeechRecognizerButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FSpeechRecognizerButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FSpeechRecognizerButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexruperez","download_url":"https://codeload.github.com/alexruperez/SpeechRecognizerButton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FSpeechRecognizerButton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273279393,"owners_count":25077314,"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-09-02T02:00:09.530Z","response_time":77,"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":["carthage","ios","push-to-talk","record-audio","siri","speech-recognition","speech-to-text","swift","uibutton","uibutton-subclass","waveform"],"created_at":"2025-02-01T22:34:29.929Z","updated_at":"2025-09-02T11:39:48.541Z","avatar_url":"https://github.com/alexruperez.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpeechRecognizerButton\n\n[![Twitter](https://img.shields.io/badge/contact-@alexruperez-0FABFF.svg?style=flat)](http://twitter.com/alexruperez)\n[![Version](https://img.shields.io/cocoapods/v/SpeechRecognizerButton.svg?style=flat)](http://cocoapods.org/pods/SpeechRecognizerButton)\n[![License](https://img.shields.io/cocoapods/l/SpeechRecognizerButton.svg?style=flat)](http://cocoapods.org/pods/SpeechRecognizerButton)\n[![Platform](https://img.shields.io/cocoapods/p/SpeechRecognizerButton.svg?style=flat)](http://cocoapods.org/pods/SpeechRecognizerButton)\n[![Swift](https://img.shields.io/badge/Swift-5-orange.svg?style=flat)](https://swift.org)\n[![Build Status](https://travis-ci.org/alexruperez/SpeechRecognizerButton.svg?branch=master)](https://travis-ci.org/alexruperez/SpeechRecognizerButton)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Swift Package Manager Compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager)\n\nUIButton subclass with push to talk recording, speech recognition and Siri-style waveform view.\n\n![SpeechRecognizerButton](https://github.com/alexruperez/SpeechRecognizerButton/raw/master/SpeechRecognizerButton.gif)\n\n## 📲 Installation\n\nSpeechRecognizerButton is available through [CocoaPods](http://cocoapods.org). To install it,\nsimply add the following line to your Podfile:\n\n```ruby\npod 'SpeechRecognizerButton'\n```\n\n#### Or you can install it with [Carthage](https://github.com/Carthage/Carthage):\n\n```ogdl\ngithub \"alexruperez/SpeechRecognizerButton\"\n```\n\n#### Or install it with [Swift Package Manager](https://swift.org/package-manager/):\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/alexruperez/SpeechRecognizerButton.git\")\n]\n```\n\n## 🐒 Usage\n\n### Configuration:\n\nAdd `NSMicrophoneUsageDescription` and `NSSpeechRecognitionUsageDescription` keys to your `Info.plist` file containing a description of how your app will use the voice recording and speech recognition.\n\n### Handling authorization:\n\n#### Automatically opening Settings when denying permission:\n\n```swift\nbutton.authorizationErrorHandling = .openSettings(completion: ...)\n```\n\n#### Custom handling:\n\n```swift\nbutton.authorizationErrorHandling = .custom(handler: { error in\n  // TODO: Your code here!\n})\n```\n\n### Handling results:\n\n```swift\nbutton.resultHandler = { recordURL, speechRecognitionResult in\n  // TODO: Your code here!\n}\n```\n\n### Handling errors:\n\n```swift\nbutton.errorHandler = { error in\n  // TODO: Your code here!\n}\n```\n\n### Assigning waveform view:\n\nJust set `weak var waveformView: SFWaveformView?` property or use the Interface Builder outlet.\n\n### Assigning activity indicator view:\n\nJust set `weak var activityIndicatorView: UIActivityIndicatorView?` property or use the Interface Builder outlet.\n\n### Customizing SFButton configuration:\n\nJust set the following properties by code or use the Interface Builder inspectables.\n\n```swift\nbutton.audioSession...\nbutton.recordURL = ...\nbutton.audioFormatSettings = [AV...Key: ...]\nbutton.maxDuration = ...\nbutton.locale = Locale....\nbutton.taskHint = SFSpeechRecognitionTaskHint....\nbutton.queue = OperationQueue....\nbutton.contextualStrings = [\"...\"]\nbutton.interactionIdentifier = \"...\"\nbutton.animationDuration = ...\nbutton.shouldVibrate = ...\nbutton.shouldSound = ...\nbutton.pushToTalk = ...\nbutton.speechRecognition = ...\nbutton.cancelOnDrag = ...\nbutton.shouldHideWaveform = ...\nbutton.cornerRadius = ...\nbutton.borderColor = ...\nbutton.borderWidth = ...\nbutton.selectedColor = ...\nbutton.highlightedColor = ...\nbutton.disabledColor = ...\nbutton.highlightedAlpha = ...\n```\n\n### Customizing SFWaveformView configuration:\n\nJust set the following properties by code or use the Interface Builder inspectables.\n\n```swift\nwaveformView.waveColor = ...\nwaveformView.numberOfWaves = ...\nwaveformView.primaryWaveLineWidth = ...\nwaveformView.secondaryWaveLineWidth = ...\nwaveformView.idleAmplitude = ...\nwaveformView.frequency = ...\nwaveformView.density = ...\nwaveformView.phaseShift = ...\nwaveformView.amplitude = ...\n```\n\n## ❤️ Etc.\n\n* [SFWaveformView](https://github.com/alexruperez/SpeechRecognizerButton/blob/master/SpeechRecognizerButton/SFWaveformView.swift#L6) based on [jyunderwood](https://github.com/jyunderwood)/[WaveformView-iOS](https://github.com/jyunderwood/WaveformView-iOS), thanks!\n* Contributions are very welcome.\n* Attribution is appreciated (let's spread the word!), but not mandatory.\n\n## 👨‍💻 Authors\n\n[alexruperez](https://github.com/alexruperez), contact@alexruperez.com\n\n## 👮‍♂️ License\n\nSpeechRecognizerButton is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexruperez%2Fspeechrecognizerbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexruperez%2Fspeechrecognizerbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexruperez%2Fspeechrecognizerbutton/lists"}