パッケージ、リポジトリ、アプリカテゴリを検索

flutter_audio_waveforms のカバー
パッケージ詳細v1.2.1+8

flutter_audio_waveforms

アプリにオーディオ波形を簡単に追加できるUIライブラリで、さまざまなカスタマイズオプションを提供します。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
26
いいね数
251
Pub ポイント
140

パッケージをインストール

flutter pub add flutter_audio_waveforms

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterパッケージで、アプリケーションへのオーディオ波形の統合を簡素化し、音楽やオーディオ再生用のカスタマイズ可能なビジュアライゼーションを提供します。Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォームのオーディオアプリに最適です。開発者は、さまざまなスタイルオプションを使ってリアルタイムまたは事前に読み込まれた波形データを簡単に表示できます。このライブラリはシンプルさとパフォーマンスを重視しており、大きなオーディオファイルでも滑らかなレンダリングを実現します。音楽プレイヤー、音声録音アプリ、音声解析ツールなどに特に役立ちます。

用途

  • 音楽プレーヤーインターフェース
  • 音声録音の可視化
  • オーディオ分析ツール
  • リアルタイム音声モニタリング
  • 音波向けの教育アプリ
  • ポッドキャスト再生UI

主な機能

  • カスタマイズ可能な波形の外観
  • リアルタイムオーディオレンダリングのサポート
  • クロスプラットフォーム互換性
  • オーディオプレイヤーとの簡単な統合
  • カスタマイズ可能な線の太さと色
  • すべてのプラットフォームでのスムーズなパフォーマンス

適している対象

  • オーディオ中心のアプリを開発する開発者
  • 動的な波形ビジュアルが必要なUIデザイナー
  • 音響物理学のための教育ソフトウェア
  • モバイルおよびデスクトップオーディオアプリケーション
  • リアルタイム音声フィードバックを必要とするアプリ

注意事項

  • リアルタイムでない使用には音声データの前処理が必要です
  • 非常に長いオーディオファイルではパフォーマンスに影響を与える可能性があります
  • 波形の可視化に限定(オーディオ処理なし)
  • 中程度から高いオーディオデータ周波数を持つアプリに最適
  • 非常に高解像度の波形には最適化されていません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pub.dev Badge MIT License Badge

A UI library for easily adding audio waveforms to your apps, with several customization options.

Web Demo - Flutter Audio Waveforms Web Demo

Features

You can use the following available waveform types.

  • Polygon
  • Rectangle
  • Squiggly
  • Curved Polygon


Need to add some gradient to your waveform? Say no more! You get it along with other customization options.


Want an active track for your audio out of the box? You get that too!


Check out the short demo of what package offers here

Getting started

The package gives you the ability to add waveforms and customize them. It's mostly like a UI library for waveforms with an additional ability to show active track for playing audio.

So it relies on you to provide the necessary audio data which it needs to draw the waveform. The data we need is basically a list of points/samples that represents that audio.

You can use this audiowaveform program to get the audio json file which will provide us the samples. After installing this program on your machine, generate the json file for an audio by using this command in your terminal.

audiowaveform -i test.mp3 -o test.json

The generated data needs to be processed following some rules which are necessary to get the waveforms drawn properly. To process the data use this processor.

Once you have the processed data points list then you can just pass it down to any of the waveforms available and get started using them.

Check out this article for detailed introduction on this section.

Usage

Usage of all waveforms available is the same with only exception of having more/less customization options for different waveforms.

 // For a regular waveform
 PolygonWaveform( 
   samples: [],
   height: height,
   width: width, 
 )

 // If you want active track for playing audio, pass [maxDuration] and [elapsedDuration]
 PolygonWaveform( 
   samples: [],
   height: height,
   width: width,
   maxDuration: maxDuration,
   elapsedDuration: elapsedDuration, 
 )

Find detailed example here.

Properties

maxDuration:

Maximum duration of the audio.

elapsedDuration:

Elapsed Duration of the audio.

samples:

List of the audio data samples.

Check the Getting Started section on how to generate this.

height :

Waveform height.

width :

Waveform width.

Customization Options

inactiveColor :

Color of the inactive waveform.

activeColor :

Color of the active waveform.

inactiveGradient :

Gradient of the inactive waveform.

activeGradient :

Gradient of the active waveform.

absolute :

Waveform drawn is one sided either above x-axis or below it depending on what invert is set to.

Defaults to false.

invert :

Flips/inverts the waveform upside down.

Defaults to false.

borderWidth :

Width of the border around waveform.

Available only for RectangleWaveform.

isRoundedRectangle :

If true then rounded rectangles are drawn instead of regular rectangles.

Available only for RectangleWaveform.

isCentered :

If true then rectangles are centered along the Y-axis with respect to their center along their height.
If [absolute] is true then this would've no effect.

Available only for RectangleWaveform.

strokeWidth :

Waveform stroke width.

Available only for SquigglyWaveform, CurvedPolygonWaveform.

inactiveBorderColor:

Border color for inactive waveform.

Available only for RectangleWaveform.

activeBorderColor:

Border color for active waveform.

Available only for RectangleWaveform.

showActiveWaveform:

Whether to show active waveform or not.

Defaults to true.

More customization options coming soon!

Contributing Guide

  • Feature request :
    If you have any new feature in mind from which this package can benefit then please let me know by filing an issue here.

  • Improvements :
    Got any suggestions on improving the package, anything from API to performance then let me know by filing the issue here.

  • Bugs:
    If you happen to come across anything that shoudln't be happening then please file an issue here describing what the bug is and how to reproduce it with attached code and preview if possible.

Additional information

What started as a challenge out of curiosity, is now a package that I hope will be helpful to many of you and it was actually really fun building it.

Learned some good stuff while working on it and I hope to make it much more going forward.

If this package helped you then I would appreciate if you ⭐️ the repo which would be enough for me to keep continue working on it 🤓 and feel free to drop by and say hi anytime.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト