{"id":13550949,"url":"https://github.com/SimformSolutionsPvtLtd/audio_waveforms","last_synced_at":"2025-04-03T01:30:58.361Z","repository":{"id":40249479,"uuid":"421303545","full_name":"SimformSolutionsPvtLtd/audio_waveforms","owner":"SimformSolutionsPvtLtd","description":"Use this plugin to generate waveforms while recording audio in any file formats supported by given encoders or from audio files. We can use gestures to scroll through the waveforms or seek to any position while playing audio and also style waveforms","archived":false,"fork":false,"pushed_at":"2025-01-02T12:57:39.000Z","size":24254,"stargazers_count":290,"open_issues_count":41,"forks_count":159,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-02T13:34:01.407Z","etag":null,"topics":["audio","audio-player","audiowaveform","audiowaves","dart","flutter","flutter-package","flutter-plugin","flutter-widget","ios"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/audio_waveforms","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimformSolutionsPvtLtd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-26T06:16:15.000Z","updated_at":"2024-12-27T15:40:58.000Z","dependencies_parsed_at":"2024-01-16T18:58:29.613Z","dependency_job_id":"b3fca764-34f3-4da0-b719-d557fda96722","html_url":"https://github.com/SimformSolutionsPvtLtd/audio_waveforms","commit_stats":{"total_commits":93,"total_committers":17,"mean_commits":5.470588235294118,"dds":0.5806451612903225,"last_synced_commit":"baee36bf23ac193afee36a72625a31669161057b"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimformSolutionsPvtLtd%2Faudio_waveforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimformSolutionsPvtLtd%2Faudio_waveforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimformSolutionsPvtLtd%2Faudio_waveforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimformSolutionsPvtLtd%2Faudio_waveforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimformSolutionsPvtLtd","download_url":"https://codeload.github.com/SimformSolutionsPvtLtd/audio_waveforms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246921990,"owners_count":20855341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-player","audiowaveform","audiowaves","dart","flutter","flutter-package","flutter-plugin","flutter-widget","ios"],"created_at":"2024-08-01T12:01:40.093Z","updated_at":"2025-04-03T01:30:53.340Z","avatar_url":"https://github.com/SimformSolutionsPvtLtd.png","language":"Dart","funding_links":[],"categories":["Dart","Flutter"],"sub_categories":["Jetpack-Compose"],"readme":"![Audio Waveforms - Simform LLC.](https://raw.githubusercontent.com/SimformSolutionsPvtLtd/audio_waveforms/main/preview/banner.png)\n\n# Audio Waveforms\n\nUse this plugin to generate waveforms while recording audio in any file formats supported\nby given encoders or from audio files. We can use gestures to scroll through the waveforms or seek to\nany position while playing audio and also style waveforms.\n\n## Preview\n\u003ca href=\"https://raw.githubusercontent.com/SimformSolutionsPvtLtd/audio_waveforms/main/preview/demo.gif\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/SimformSolutionsPvtLtd/audio_waveforms/main/preview/demo.gif\" width=\"390px;\" height=\"700px;\"/\u003e\u003c/a\u003e\n\n\n**Check [migration guide](https://github.com/SimformSolutionsPvtLtd/audio_waveforms/blob/main/migration_guide.md) to migrate from 0.1.5+1 to 1.0.0**\n\n\n## Recorder\n\n### Platform specific configuration\n\n\n**Android**\n\nChange the minimum Android sdk version to 21 (or higher) in your `android/app/build.gradle` file.\n```\nminSdkVersion 21\n```\n\nAdd RECORD_AUDIO permission in `AndroidManifest.xml`\n```\n\u003cuses-permission android:name=\"android.permission.RECORD_AUDIO\" /\u003e\n```\n\n\n**IOS**\n\nAdd this two rows in `ios/Runner/Info.plist`\n```\n\u003ckey\u003eNSMicrophoneUsageDescription\u003c/key\u003e\n\u003cstring\u003eThis app requires Mic permission.\u003c/string\u003e\n```\nThis plugin requires ios 10.0 or higher. So add this line in `Podfile`\n```\nplatform :ios, '12.0'\n```\n**Installing**\n\n1.  Add dependency to `pubspec.yaml`\n\n```dart\ndependencies:\n    audio_waveforms: \u003clatest-version\u003e\n```\n*Get the latest version in the 'Installing' tab on [pub.dev](https://pub.dev/packages/audio_waveforms)*\n\n2.  Import the package.\n```dart\nimport 'package:audio_waveforms/audio_waveforms.dart';\n```\n\n### Usage\n1. Recording audio\n```dart\nRecorderController controller = RecorderController();      // Initialise\nawait controller.record(path: 'path');                     // Record (path is optional)\nfinal hasPermission = await controller.checkPermission();  // Check mic permission (also called during record)\nawait controller.pause();                                  // Pause recording\nfinal path = await controller.stop();                      // Stop recording and get the path\ncontroller.refresh();                                      // Refresh waveform to original position\ncontroller.dispose();                                      // Dispose controller\n```\n\n2. Use `AudioWaveforms` widget in widget tree\n```dart\nAudioWaveforms(\n  size: Size(MediaQuery.of(context).size.width, 200.0),\n  recorderController: controller,\n  enableGesture: true,\n  waveStyle: WaveStyle(\n    ...\n    color: Colors.white,\n    showDurationLabel: true,\n    spacing: 8.0,\n    showBottom: false,\n    extendWaveform: true,\n    showMiddleLine: false,\n    gradient: ui.Gradient.linear(\n      const Offset(70, 50),\n      Offset(MediaQuery.of(context).size.width / 2, 0),\n      [Colors.red, Colors.green],\n  ),\n  ...\n  ),\n),\n```\n**Advance usage**\n```dart\ncontroller.updateFrequency = const Duration(milliseconds: 100);  // Update speed of new wave\ncontroller.androidEncoder = AndroidEncoder.aac;                  // Changing android encoder \ncontroller.androidOutputFormat = AndroidOutputFormat.mpeg4;      // Changing android output format\ncontroller.iosEncoder = IosEncoder.kAudioFormatMPEG4AAC;         // Changing ios encoder\ncontroller.sampleRate = 44100;                                   // Updating sample rate\ncontroller.bitRate = null;                                       // Updating bitrate\ncontroller.onRecorderStateChanged.listen((state){});             // Listening to recorder state changes\ncontroller.onCurrentDuration.listen((duration){});               // Listening to current duration updates\ncontroller.onRecordingEnded.listen((duration));                  // Listening to audio file duration\ncontroller.recordedDuration;                                     // Get recorded audio duration \ncontroller.elapsedDuration;                                      // Get currently recorded audio duration\ncontroller.currentScrolledDuration;                              // Current duration position notifier\ncontroller.overrideAudioSession = true                           // Use default AudioSession config or not \n```\n\n## Player\n\n### Usage\n```dart\nPlayerController controller = PlayerController();                   // Initialise\n// Extract waveform data\nfinal waveformData = await controller.extractWaveformData(\n    path: 'path',\n    noOfSamples: 100,\n);\n// Or directly extract from preparePlayer and initialise audio player\nawait controller.preparePlayer(\n    path: 'path',\n    shouldExtractWaveform: true,\n    noOfSamples: 100,\n    volume: 1.0,\n); \nawait controller.startPlayer(finishMode: FinishMode.stop);          // Start audio player\nawait controller.pausePlayer();                                     // Pause audio player\nawait controller.stopPlayer();                                      // Stop audio player\nawait controller.setVolume(1.0);                                    // Set volume level\nawait controller.seekTo(5000);                                      // Seek audio\nawait controller.setRate(1.0);                                      // Update speed audio playback\nfinal duration = await controller.getDuration(DurationType.max);    // Get duration of audio player\ncontroller.updateFrequency = UpdateFrequency.low;                   // Update reporting rate of current duration.\ncontroller.onPlayerStateChanged.listen((state) {});                 // Listening to player state changes\ncontroller.onCurrentDurationChanged.listen((duration) {});          // Listening to current duration changes\ncontroller.onCurrentExtractedWaveformData.listen((data) {});        // Listening to latest extraction data\ncontroller.onExtractionProgress.listen((progress) {});              // Listening to extraction progress\ncontroller.onCompletion.listen((_){});                              // Listening to audio completion\ncontroller.stopAllPlayer();                                         // Stop all registered audio players\ncontroller.dispose();                                               // Dispose controller\n```\n\n**Use `AudioFileWaveforms` widget in widget tree**\n```dart\nAudioFileWaveforms(\n size: Size(MediaQuery.of(context).size.width, 100.0),\n playerController: controller,\n enableSeekGesture: true,\n waveformType: WaveformType.long,\n waveformData: [],\n playerWaveStyle: const PlayerWaveStyle(\n      fixedWaveColor: Colors.white54,\n      liveWaveColor: Colors.blueAccent,\n      spacing: 6,\n      ...\n      ),\n      ...\n);\n```\n\n## Main Contributors\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Ujas-Majithiya\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/56400956?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eUjas Majithiya\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/DevarshRanpara\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/26064415?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDevarsh Ranpara\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimformSolutionsPvtLtd%2Faudio_waveforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSimformSolutionsPvtLtd%2Faudio_waveforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimformSolutionsPvtLtd%2Faudio_waveforms/lists"}