dart_web_audio 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

dart_web_audio #

A thin wrap over JS audio APIs for Dart/Flutter

[next] #

0.1.2 #

  • Adding example

0.1.1 #

  • Fix warnings and lint issues
  • Add CHANGELOG.md

0.1.0 #

  • First version of the package, contains the base of the wrapper

example/main.dart

import 'dart:html';

import 'package:dart_web_audio/dart_web_audio.dart';

void main() async {
  final AudioContext _audioCtx = AudioContext();

  const kUrl2 = 'https://luan.xyz/files/audio/nasa_on_a_mission.mp3';
  final HttpRequest response = await HttpRequest.request(kUrl2, responseType: 'arraybuffer');
  final AudioBuffer buffer = await _audioCtx.decodeAudioData(response.response);

  final node = _audioCtx.createBufferSource();
  node.buffer = buffer;

  node.start();
}

Use this package as a library

1. Depend on it

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


dependencies:
  dart_web_audio: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:dart_web_audio/dart_web_audio.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
59
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14

Analysis suggestions

Package not compatible with runtime flutter-native on android

Because:

  • package:dart_web_audio/dart_web_audio.dart that imports:
  • package:js/js_util.dart that imports:
  • dart:js_util

Package not compatible with runtime flutter-native on ios

Because:

  • package:dart_web_audio/dart_web_audio.dart that imports:
  • package:js/js_util.dart that imports:
  • dart:js_util

Package not compatible with runtime flutter-native on linux

Because:

  • package:dart_web_audio/dart_web_audio.dart that imports:
  • package:js/js_util.dart that imports:
  • dart:js_util

Package not compatible with runtime flutter-native on macos

Because:

  • package:dart_web_audio/dart_web_audio.dart that imports:
  • package:js/js_util.dart that imports:
  • dart:js_util

Package not compatible with runtime flutter-native on windows

Because:

  • package:dart_web_audio/dart_web_audio.dart that imports:
  • package:js/js_util.dart that imports:
  • dart:js_util

Package not compatible with runtime native

Because:

  • package:dart_web_audio/dart_web_audio.dart that imports:
  • package:js/js_util.dart that imports:
  • dart:js_util

Package not compatible with runtime native-aot

Because:

  • package:dart_web_audio/dart_web_audio.dart that imports:
  • package:js/js_util.dart that imports:
  • dart:js_util

Health suggestions

Fix lib/dart_web_audio.dart. (-1.49 points)

Analysis of lib/dart_web_audio.dart reported 3 hints:

line 142 col 16: The declaration '_Worklet' isn't referenced.

line 1003 col 16: The declaration '_BaseAudioContext' isn't referenced.

line 1046 col 16: The declaration '_AudioContext' isn't referenced.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
js ^0.6.0 0.6.2
Dev dependencies
http ^0.12.0+4