// ignore_for_file: deprecated_member_use import 'dart:html' as html; import 'dart:convert'; import 'dart:typed_data'; import 'dart:math' as math; class TeddyAudio { final html.AudioElement _audio = html.AudioElement(); bool enabled = false; String status = 'Audio disabled on this device'; String? _url; int _generation = 0; TeddyAudio() { _audio.onEnded.listen((_) { status = 'Cue finished'; }); _audio.onError.listen((_) { status = 'Browser audio error ${_audio.error?.code}. Use Play current hint here to retry.'; }); } Future enable() async { // Unlock this exact media element in the user's tap handler (required on phones). final data = ByteData(16044); void text(int offset, String value) { for (var i=0;i