https://github.com/nrubin29/flutter_acrcloud
A Flutter plugin for the ACRCloud music recognition API. This plugin provides a simple interface for using ACRCloud to recognize music from the device's microphone.
https://github.com/nrubin29/flutter_acrcloud
acrcloud flutter flutter-plugin
Last synced: 6 days ago
JSON representation
A Flutter plugin for the ACRCloud music recognition API. This plugin provides a simple interface for using ACRCloud to recognize music from the device's microphone.
- Host: GitHub
- URL: https://github.com/nrubin29/flutter_acrcloud
- Owner: nrubin29
- License: bsd-3-clause
- Created: 2020-06-06T01:21:36.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-10T01:52:21.000Z (5 months ago)
- Last Synced: 2025-04-03T19:13:03.156Z (about 2 months ago)
- Topics: acrcloud, flutter, flutter-plugin
- Language: Objective-C
- Homepage: https://pub.dev/packages/flutter_acrcloud
- Size: 5.1 MB
- Stars: 11
- Watchers: 2
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_acrcloud
A Flutter plugin for the ACRCloud music recognition API.
This is a third-party plugin; there is no relation between the developer and ACRCloud.**Note**: I built this plugin to support [a personal project](https://github.com/nrubin29/finale).
As such, it is very bare bones and potentially buggy.
If you encounter a bug or need a feature added, you can open an issue or, better yet, fix it yourself and submit a PR.## Setup
In order to get access to the microphone, you have to explicitly list the required permission in your iOS and Android apps.
### iOS
1. Open `ios/Runner/Info.plist`.
2. Add the following lines somewhere inside of the ``:```xml
NSMicrophoneUsageDescription
Recognize the music around you
```3. You can replace the `` with whatever message you want. This message will be displayed in the alert that asks the user to grant permission to access to the microphone.
### Android
1. Open `android/app/src/main/AndroidManifest.xml`
2. Add the following line inside of the `` and above the ``:```xml
```## Usage
Consult the `example` app for a real-world example.
1. Call `ACRCloud.setUp()` to provide your API key, API secret, and preferred host. `setUp()` takes an instance of `ACRCloudConfig`.
2. When you want to recognize a song, call `ACRCloud.startSession()` to start a recording session. You will get an instance of `ACRCloudSession` that you can use to interact with the session.
3. To get the current volume, you can use the `volume` property of `ACRCloudSession`. This is a `Stream` that is updated every time a new volume value is recoded.
4. To cancel a session, just call `cancel()` on the session.
5. To get the result of a session, you can `await` the `result` property of the session. If the result is `null`, then the request was cancelled. Otherwise, you'll get an instance of `ACRCloudResponse` that contains all the information.