{"id":1420,"url":"https://github.com/Luccifer/BPM-Analyser","last_synced_at":"2025-08-02T04:31:32.285Z","repository":{"id":75897929,"uuid":"86576314","full_name":"Luccifer/BPM-Analyser","owner":"Luccifer","description":"Analyser BPM in Swift for your music/sounds/records, whatever..","archived":true,"fork":false,"pushed_at":"2017-12-26T10:57:25.000Z","size":20388,"stargazers_count":79,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-15T17:57:59.122Z","etag":null,"topics":["analyser","analyzer","bpm","ios","media","music","songs","swift","swift4"],"latest_commit_sha":null,"homepage":null,"language":"C","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/Luccifer.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-29T11:53:03.000Z","updated_at":"2024-07-01T22:06:41.000Z","dependencies_parsed_at":"2024-01-02T20:59:41.306Z","dependency_job_id":"0e20bdbf-87cf-43e0-9e75-38e117fd6579","html_url":"https://github.com/Luccifer/BPM-Analyser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luccifer%2FBPM-Analyser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luccifer%2FBPM-Analyser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luccifer%2FBPM-Analyser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luccifer%2FBPM-Analyser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luccifer","download_url":"https://codeload.github.com/Luccifer/BPM-Analyser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228438934,"owners_count":17920017,"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":["analyser","analyzer","bpm","ios","media","music","songs","swift","swift4"],"created_at":"2024-01-05T20:15:46.051Z","updated_at":"2024-12-06T08:31:07.209Z","avatar_url":"https://github.com/Luccifer.png","language":"C","funding_links":[],"categories":["Media"],"sub_categories":["Audio","Other free courses"],"readme":"# BPM-Analyser\n\n![](https://img.shields.io/badge/swift-4.0-green.svg)\n![](https://img.shields.io/badge/platform-ios-gray.svg)\n\nAnalyser BPM in Swift for your music/sounds/records, whatever..\nPowered with [Superpowered](http://superpowered.com)\n\n# Preview:\n![](https://github.com/Luccifer/BPM-Analyser/blob/master/preview.gif)\n\n# How To:\n\n## Copy theese files to your project:\n- BMPAnalyzer.swift\n- Superpower directory\n\n## Also add theese frameworks to your Linked Frameworks and Libraries\n- Add AudioToolbox.framework\n- CoreMedia.framework\n- AVFoundation\n- libSuperpoweredAudioIOS.a (From repo: /src/Superpowered, you added it to project in the previous step\n\n## In your code implementation you can call Singleton method by:\n```swift\n public func getBpmFrom(_ url: URL, completion: (String?) -\u003e ()) -\u003e String\n```\nExample:\n```swift\nguard let filePath = Bundle.main.path(forResource: \"TestMusic\", ofType: \"m4a\"),\nlet url = URL(string: filePath) else {return \"error occured, check fileURL\"}\nBPMAnalyzer.core.getBpmFrom(url, completion: nil)\n\n```\n\nYou can stuck it with MPMediaPicker in delegate like this:\n```swift\nimport UIKit\nimport MediaPlayer\n\nclass YourClassViewController: UIViewController {\n\n let mediaPicker: MPMediaPickerController = MPMediaPickerController(mediaTypes: .music)\n    lazy var bpmLabel: UILabel = {\n        let label = UILabel()\n        label.frame.size.height = 300\n        label.frame.size.width = UIScreen.main.bounds.width - 32\n        label.numberOfLines = 2\n        return label\n    }()\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        mediaPicker.allowsPickingMultipleItems = false\n        mediaPicker.delegate = self\n        present(mediaPicker, animated: true, completion: nil)\n        // Do any additional setup after loading the view, typically from a nib.\n    }\n}\n\nextension YourClassViewController: MPMediaPickerControllerDelegate {\n\n    func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems\n        mediaItemCollection: MPMediaItemCollection) {\n        guard let asset = mediaItemCollection.items.first,\n            let url = asset.assetURL else {return}\n        _ = BPMAnalyzer.core.getBpmFrom(url, completion: {[weak self] (bpm) in\n            self?.addLabelWith(bpm)\n            self?.mediaPicker.dismiss(animated: true, completion: nil)\n        })\n    }\n    \n    func addLabelWith(_ bpm: String) {\n        bpmLabel.text = String(describing:bpm)\n        view.addSubview(bpmLabel)\n        bpmLabel.center = view.center\n        view.layoutIfNeeded()\n    }\n}\n\n```\n### Look Example project in case of misunderstanding! :)\n\n## WHY?\nCause I can :D But in fact, I did't find any libs/frameworks to get BPM from media files...\n\n# WHY Superpowered?\nCause it is the [fastest lib I have found](http://superpowered.com)\n\n# Feel FREE to PR or contribuctions/issues/remarks\n\n## BUGS/Fixes Contributors:\n@o1exij - for the advice and reseraching the bug in BPM counting\n\n@MikaTck - for alerting fatal error + Swift4 migration\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLuccifer%2FBPM-Analyser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLuccifer%2FBPM-Analyser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLuccifer%2FBPM-Analyser/lists"}