bass_boost 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 42

bass_boost #

A flutter plugin to increase bass in any audio.

Initialize the object of BassBoost class like this #

 BassBoost bassBoost = new BassBoost( id );
 // id here is the audioSessionId for the playing audio.

Enable it by calling the function setEnabled(bool b) using the same object initialized above #

bassBoost.setEnabled(true);

Change the strength of bass by calling the function setStrength(int strength) on the object initialized above #

bassBoost.setStrength(i);
//i = intger value ranging from 0 to 1000 including the extremes ([0,1000]) . 
//All values less than 0 and greater than 1000 will be neglected

Check whether the bass is already enabled or not by calling the function getEnabled() using the same object initialized above #

bool b = await bassBoost.getEnabled();//b will get a boolean value in return.

Get current strength of the bass by calling getStrength() using the same object initialized above #

int strength = await bassBoost.getStrength();//strength will get an integer value in return.

0.1.1 #

Updated the description of the plugin and also formatted bass_boost.dart

0.1.0 #

=> Only supported in android => Control bass of any audio playing in the device.

Uses the BassBoost Class in AudioEffects package in android.

example/lib/main.dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:bass_boost/bass_boost.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  BassBoost bassBoost;
  bool enabled = false;
  double strength = 0;

  @override
  void initState() {
    super.initState();
    initAudioSessionId(id: 0);
    // this line will give error as you need to pass an audio session Id as a
    // value to the named parameter id:
    // and if there is no audio with the id that you passed , this line will give error.

    updateBassEnabled();
    updateBassStrength();
  }

  initAudioSessionId({@required int id}) {
    bassBoost = new BassBoost(
      audioSessionId: id,
    );
  }

  updateBassEnabled() {
    bassBoost.getEnabled().then((bool b) {
      enabled = b;
      setState(() {});
    });
  }

  updateBassStrength() {
    bassBoost.getStrength().then((int i) {
      strength = i.toDouble();
      setState(() {});
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(primaryColor: Colors.teal, brightness: Brightness.dark),
      home: Scaffold(
        body: Center(
            child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Icon(
              Icons.speaker_phone,
              size: 100.0,
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                Text(
                  "ENJOY THE BASS",
                  textAlign: TextAlign.center,
                  style: TextStyle(
                      fontSize: 25.0,
                      fontWeight: FontWeight.w700,
                      letterSpacing: 2.0),
                ),
                Switch(
                  onChanged: (bool b) {
                    bassBoost.setEnabled(enabled: b);
                    updateBassEnabled();
                  },
                  value: enabled,
                ),
              ],
            ),
            Slider(
              value: strength,
              onChanged: (d) {
                bassBoost.setStrength(strength: d.toInt());
                updateBassStrength();
              },
              min: 0,
              max: 1000,
              divisions: 1000,
              label: strength.toInt().toString(),
            ),
            Padding(
              padding: const EdgeInsets.only(top: 100),
              child: OutlineButton(
                onPressed: () {
                  exit(0);
                },
                child: Text("Exit the app"),
              ),
            ),
          ],
        )),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  bass_boost: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bass_boost/bass_boost.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
62
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:bass_boost/bass_boost.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:bass_boost/bass_boost.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:bass_boost/bass_boost.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:bass_boost/bass_boost.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [bass_boost] that is in a package requiring null.

Maintenance suggestions

Package is getting outdated. (-38.08 points)

The package was last published 72 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8