haudiotagger_fingerprint 0.3.0 copy "haudiotagger_fingerprint: ^0.3.0" to clipboard
haudiotagger_fingerprint: ^0.3.0 copied to clipboard

Perceptual audio fingerprinting for Flutter. Identify and compare recordings by content - duplicate detection, library cleanup, song matching. Powered by Rust.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:haudiotagger_fingerprint/haudiotagger_fingerprint.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _firstCtrl = TextEditingController();
  final _secondCtrl = TextEditingController();
  String _result = 'Enter two audio file paths to compare them.';

  Future<void> _compare() async {
    try {
      final a = await HaudioFingerprint.fingerprint(_firstCtrl.text.trim());
      final b = await HaudioFingerprint.fingerprint(_secondCtrl.text.trim());
      final score = await a.similarityTo(b);
      setState(() {
        _result = score >= 0.8
            ? 'Same recording (similarity ${score.toStringAsFixed(3)}).'
            : 'Different recordings (similarity ${score.toStringAsFixed(3)}).';
      });
    } on FingerprintError catch (e) {
      setState(() => _result = 'Error: $e');
    }
  }

  @override
  void dispose() {
    _firstCtrl.dispose();
    _secondCtrl.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('haudiotagger_fingerprint demo')),
        body: Padding(
          padding: const EdgeInsets.all(16),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              TextField(
                controller: _firstCtrl,
                decoration:
                    const InputDecoration(labelText: 'First audio file path'),
              ),
              const SizedBox(height: 8),
              TextField(
                controller: _secondCtrl,
                decoration:
                    const InputDecoration(labelText: 'Second audio file path'),
              ),
              const SizedBox(height: 8),
              ElevatedButton(
                onPressed: _compare,
                child: const Text('Compare'),
              ),
              const SizedBox(height: 16),
              Text(_result),
            ],
          ),
        ),
      ),
    );
  }
}
8
likes
160
points
269
downloads

Documentation

API reference

Publisher

verified publisherhirdaya-shrestha.com.np

Weekly Downloads

Perceptual audio fingerprinting for Flutter. Identify and compare recordings by content - duplicate detection, library cleanup, song matching. Powered by Rust.

Repository (GitHub)
View/report issues

Topics

#audio #fingerprint #duplicate-detection #audio-identification

License

MIT (license)

Dependencies

ffi, flutter, flutter_rust_bridge, freezed_annotation, haudiotagger_interface, plugin_platform_interface

More

Packages that depend on haudiotagger_fingerprint

Packages that implement haudiotagger_fingerprint