{"id":1428,"url":"https://github.com/fulldecent/FDSoundActivatedRecorder","last_synced_at":"2025-08-06T13:31:53.743Z","repository":{"id":12713613,"uuid":"15386170","full_name":"fulldecent/FDSoundActivatedRecorder","owner":"fulldecent","description":"Start recording when the user speaks","archived":false,"fork":false,"pushed_at":"2021-12-22T05:07:08.000Z","size":623,"stargazers_count":288,"open_issues_count":2,"forks_count":64,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-08-13T19:14:40.142Z","etag":null,"topics":["audio","ios","listen","sound","swift","voice-commands","voice-control","voice-recognition"],"latest_commit_sha":null,"homepage":null,"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/fulldecent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["fulldecent"],"custom":["https://www.paypal.me/fulldecent","https://amazon.com/hz/wishlist/ls/EE78A23EEGQB"]}},"created_at":"2013-12-23T02:42:44.000Z","updated_at":"2024-08-13T19:14:40.143Z","dependencies_parsed_at":"2022-11-28T10:34:26.798Z","dependency_job_id":null,"html_url":"https://github.com/fulldecent/FDSoundActivatedRecorder","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDSoundActivatedRecorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDSoundActivatedRecorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDSoundActivatedRecorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulldecent%2FFDSoundActivatedRecorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fulldecent","download_url":"https://codeload.github.com/fulldecent/FDSoundActivatedRecorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215780271,"owners_count":15929790,"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","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":["audio","ios","listen","sound","swift","voice-commands","voice-control","voice-recognition"],"created_at":"2024-01-05T20:15:46.236Z","updated_at":"2024-08-17T16:30:24.141Z","avatar_url":"https://github.com/fulldecent.png","language":"Swift","funding_links":["https://github.com/sponsors/fulldecent","https://www.paypal.me/fulldecent","https://amazon.com/hz/wishlist/ls/EE78A23EEGQB"],"categories":["Media","Libs","Media and Graphics","Audio [🔝](#readme)"],"sub_categories":["Audio"],"readme":"# FDSoundActivatedRecorder\n\n[![CI Status](http://img.shields.io/travis/fulldecent/FDSoundActivatedRecorder.svg?style=flat)](https://travis-ci.org/fulldecent/FDSoundActivatedRecorder)\n[![Version](https://img.shields.io/cocoapods/v/FDSoundActivatedRecorder.svg?style=flat)](http://cocoadocs.org/docsets/FDSoundActivatedRecorder)\n[![License](https://img.shields.io/cocoapods/l/FDSoundActivatedRecorder.svg?style=flat)](http://cocoadocs.org/docsets/FDSoundActivatedRecorder)\n[![Platform](https://img.shields.io/cocoapods/p/FDSoundActivatedRecorder.svg?style=flat)](http://cocoadocs.org/docsets/FDSoundActivatedRecorder)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Readme Score](http://readme-score-api.herokuapp.com/score.svg?url=fulldecent/FDSoundActivatedRecorder)](http://clayallsopp.github.io/readme-score?url=fulldecent/FDSoundActivatedRecorder)\n\nStart recording when the user speaks. All you have to do is tell us when to\nstart listening. Then we wait for an audible noise and start recording. This is\nmostly useful for user speech input and the \"Start talking now\" prompt.\n\n**:pizza: Virtual tip jar: https://amazon.com/hz/wishlist/ls/EE78A23EEGQB**\n\nFeatures\n--------\n\n-   You can start recording when sound is detected, or immediately\n-   Sound stops recording when the user is done talking\n-   Works with ARC and iOS 5+\n\n## Installation\n\nAdd this to your project using Swift Package Manager. In Xcode that is simply: File \u003e Swift Packages \u003e Add Package Dependency... and you're done. Alternative installation options are shown below for legacy projects.\n\n### CocoaPods\n\nIf you are already using [CocoaPods](http://cocoapods.org), just add 'FDSoundActivatedRecorder' to your `Podfile` then run `pod install`.\n\n### Carthage\n\nIf you are already using [Carthage](https://github.com/Carthage/Carthage), just add to your `Cartfile`:\n\n```ogdl\ngithub \"fulldecent/FDSoundActivatedRecorder\" ~\u003e 0.1\n```\n\nThen run `carthage update` to build the framework and drag the built `FDSoundActivatedRecorder`framework into your Xcode project.\n\nUsage\n-----\n\nFirst, install by adding `pod 'FDSoundActivatedRecorder', '~\u003e 1.0.0'` to your\nPodfile.\n\nImport the project with:\n\n    import FDSoundActivatedRecorder\n\nThen begin listening with:\n\n    self.recorder = FDSoundActivatedRecorder()\n    self.recorder.delegate = self\n    self.recorder.startListening()\n\nA full implementation example is provided in this project.\n\nIf your app is in the app store, I would much appreciate if you could add your\napp to https://www.cocoacontrols.com/controls/fdsoundactivatedrecorder under\n\"Apps using this control\" and \"I Use This Control\".\n\n### Regular Recorder\n\nIf you want to use it as a regular recorder, without the ability to of trimming the audio.\n\n1. Begin listening:\n```\nself.recorder.startListening()\n```\n2. Begin recording:\n```\nself.recorder.startRecording()\n```\n3. Finally, you can stop recording using the following method:\n```\nself.recorder.stopAndSaveRecording()\n```\nFull API\n--------\n\nThe full API, from\n[FDSoundActivatedRecorder.swift](\u003chttps://github.com/fulldecent/FDSoundActivatedRecorder/blob/master/FDSoundActivatedRecorder.swift\u003e)\nis copied below:\n\n````\n@objc protocol FDSoundActivatedRecorderDelegate {\n    /// A recording was triggered or manually started\n    func soundActivatedRecorderDidStartRecording(recorder: FDSoundActivatedRecorder)\n\n    /// No recording has started or been completed after listening for `TOTAL_TIMEOUT_SECONDS`\n    func soundActivatedRecorderDidTimeOut(recorder: FDSoundActivatedRecorder)\n\n    /// The recording and/or listening ended and no recording was captured\n    func soundActivatedRecorderDidAbort(recorder: FDSoundActivatedRecorder)\n\n    /// A recording was successfully captured\n    func soundActivatedRecorderDidFinishRecording(recorder: FDSoundActivatedRecorder, andSaved file: NSURL)\n}\n\nclass FDSoundActivatedRecorder : NSObject {\n    /// A log-scale reading between 0.0 (silent) and 1.0 (loud), nil if not recording\n    dynamic var microphoneLevel: Double\n\n    /// Receiver for status updates\n    weak var delegate: FDSoundActivatedRecorderDelegate?\n\n    /// Listen and start recording when triggered\n    func startListening()\n\n    /// Go back in time and start recording `RISE_TRIGGER_INTERVALS` ago\n    func startRecording()\n\n    /// End the recording and send any processed \u0026 saved file to `delegate`\n    func stopAndSaveRecording()\n\n    /// End any recording or listening and discard any recorded files\n    func abort()\n\n    /// This is a PRIVATE method but it must be public because a selector is used in NSTimer (Swift bug)\n    func interval()\n}\n````\n\nTechnical discussion\n--------------------\n\nThis library is tuned for human speech detection using Apple retail iOS devices\nin a quiet or noisy environement. You are welcome to tune the audio detection\nconstants of this program for any special needs you may have. Following is a\ntechnical description of how the algorithm works from\n`FDSoundActivatedRecorder.swift`.\n\n````\nV               Recording\nO             /-----------\\\nL            /             \\Fall\nU           /Rise           \\\nM          /                 \\\nE  --------                   --------\n   Listening                  Done\n````\n\n* We listen and save audio levels every `INTERVAL`\n* When several levels exceed the recent moving average by a threshold, we record\n* (The exceeding levels are not included in the moving average)\n* When several levels deceed the recent moving average by a threshold, we stop recording\n* (The deceeding levels are not included in the moving average)\n\nSponsorship\n-----------\n\n`[ YOUR LOGO HERE `]\n\nPlease contact github.com@phor.net to discuss adding your company logo above and supporting this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulldecent%2FFDSoundActivatedRecorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffulldecent%2FFDSoundActivatedRecorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulldecent%2FFDSoundActivatedRecorder/lists"}