A totally useful Flutter package for generating random Balablu sounds.
The balablu package provides a simple way to generate random Balablu sounds in your Flutter application (very crucial stuff for your app you know. Absolutely not useless🙃.). It also lets you control the frequency at which the audio clip is played and provides an option to disable the sound by shaking the device (nifty, that.😌).
On Android:
-
Include the VIBRATE permission in AndroidManifest.xml:
<uses-permission android:name="android.permission.VIBRATE"/>
-
Set
compileSDKVersion
to 33 in android\app\build.gradle.
Import the balablu package:
import 'package:balablu/balablu.dart';
Initialize Balablu sound generation:
await Balablu.init();
This initializes the Balablu sound generator with the default settings. The audio clip will be played at a very low frequency.
You can customize the frequency using the Frequency
class. The smaller the frequency value, the fewer times the audio clip is played. The Frequencies
class provides some predefined frequency constants:
Frequencies.veryLow
Frequencies.low
Frequencies.medium
Frequencies.high
Frequencies.veryHigh
You can also pass a Frequency
object to the init()
method to set a custom frequency:
// That's really low by the way.
await Balablu.init(frequency: Frequency(milliHertz: 2));
By default, shaking the device will toggle the sound on or off. When the device is shook, it vibrates for one second to indicate disabling and half a second to indicate enabling.
If you want to disable this feature, you can set the shakeToDisable
parameter to false
:
await Balablu.init(shakeToDisable: false);
Contributions to the balablu package are welcome! If you find any issues, have suggestions for improvements, or would like to add new features, feel free to contribute. Here's how you can get involved:
- Fork the repository on GitHub.
- Create a new branch with a descriptive name for your feature or bug fix.
- Make your changes and ensure that the code follows the project's style guidelines.
- Write tests to cover your changes and ensure that existing tests pass.
- Commit your changes and push the branch to your forked repository.
- Submit a pull request to the main repository, describing your changes in detail.
Please ensure that your pull request adheres to the following guidelines:
- Provide a clear and descriptive title for your pull request.
- Include a detailed description of the changes you have made.
- If your pull request addresses an existing issue, reference it in the description using the #issue_number format.
- Ensure that your code is well-documented, follows best practices, and is properly formatted.
- Include relevant tests for the changes you have made.
By contributing to the balablu package, you agree that your contributions will be licensed under the project's LICENSE.
Thank you for your interest in improving the balablu package! Your contributions are greatly appreciated.
This is what happens when you can just generate stuff with ChatGPT 😄😄.
This package is licensed under the BSD-2 License. See the LICENSE file for more details.
Please file issues to send feedback or report a bug. Thank you!