flutter_detect_pitch 0.0.1+1 copy "flutter_detect_pitch: ^0.0.1+1" to clipboard
flutter_detect_pitch: ^0.0.1+1 copied to clipboard

A Flutter plugin for real-time pitch detection using the device microphone with native audio processing for iOS and Android.

example/lib/main.dart

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

void main() => runApp(const PitchTestApp());

class PitchTestApp extends StatelessWidget {
  const PitchTestApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: PitchHomePage());
  }
}

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

  @override
  PitchHomePageState createState() => PitchHomePageState();
}

class PitchHomePageState extends State<PitchHomePage> {
  double? _frequency;

  @override
  void initState() {
    super.initState();
    IosPitchDetector.pitchStream.listen((frequency) {
      setState(() {
        _frequency = frequency;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Pitch Detector Example')),
      body: Center(
        child: Text(
          _frequency != null
              ? 'Detected: ${_frequency!.toStringAsFixed(2)} Hz'
              : 'Listening...',
          style: const TextStyle(fontSize: 24),
        ),
      ),
    );
  }
}
0
likes
150
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for real-time pitch detection using the device microphone with native audio processing for iOS and Android.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_detect_pitch

Packages that implement flutter_detect_pitch