{"id":13790632,"url":"https://github.com/ImnIrdst/iiVisu","last_synced_at":"2025-05-12T09:33:03.220Z","repository":{"id":36985767,"uuid":"308376567","full_name":"ImnIrdst/iiVisu","owner":"ImnIrdst","description":"A player/ recorder visualizer with the swipe to seek functionality.","archived":false,"fork":false,"pushed_at":"2023-01-25T01:07:49.000Z","size":3866,"stargazers_count":148,"open_issues_count":14,"forks_count":14,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-18T05:38:21.865Z","etag":null,"topics":["android","android-visualizer","audio-visualizer","custom-view","visualizer"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/ImnIrdst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-29T15:50:40.000Z","updated_at":"2024-09-20T15:32:51.000Z","dependencies_parsed_at":"2023-01-17T12:01:37.659Z","dependency_job_id":null,"html_url":"https://github.com/ImnIrdst/iiVisu","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImnIrdst%2FiiVisu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImnIrdst%2FiiVisu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImnIrdst%2FiiVisu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImnIrdst%2FiiVisu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImnIrdst","download_url":"https://codeload.github.com/ImnIrdst/iiVisu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253709382,"owners_count":21951127,"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":["android","android-visualizer","audio-visualizer","custom-view","visualizer"],"created_at":"2024-08-03T22:00:48.542Z","updated_at":"2025-05-12T09:33:00.668Z","avatar_url":"https://github.com/ImnIrdst.png","language":"Kotlin","funding_links":[],"categories":["Index"],"sub_categories":[],"readme":"# iiVisu\n[![](https://jitpack.io/v/ImnIrdst/iiVisu.svg)](https://jitpack.io/#ImnIrdst/iiVisu)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-iiVisu-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8186)\n\nA player/ recorder visualizer with the swipe to seek functionality.\n\n# Demo\n\n![](https://github.com/ImnIrdst/iiVisu/blob/main/demo/iivisu-record.gif)\n![](https://github.com/ImnIrdst/iiVisu/blob/main/demo/iivisu-play.gif)\n\n# Setup\n\nStep 1. Add the JitPack repository to your build file\n\nAdd it in your root build.gradle at the end of repositories:\n```\nallprojects {\n  repositories {\n    ...\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\nStep 2. Add the dependency\n```\ndependencies {\n  implementation 'com.github.imnirdst:iivisu:1.1.0'\n}\n```\n\n# Usage\n\nThis repository contains a sample app that shows how to use iiVisu.\n\n## Recorder\n\n[`RecorderVisualizer`](https://github.com/ImnIrdst/iiVisu/blob/main/iivisu/src/main/java/com/imn/iivisu/RecorderVisualizer.kt) doesn't support swipe to seek functionality.\n\n```XML\n\u003ccom.imn.iivisu.RecorderVisualizer\n    android:id=\"@+id/visualizer\"\n    android:layout_width=\"0dp\"\n    android:layout_height=\"256dp\"\n    app:maxAmp=\"100\"\n    app:barWidth=\"3dp\"\n    app:spaceBetweenBar=\"2dp\"\n    app:loadedBarPrimeColor=\"@color/primaryLight\"\n    app:backgroundBarPrimeColor=\"@color/gray\"\n    app:layout_constraintBottom_toTopOf=\"@id/timeline_text_view\"\n    app:layout_constraintTop_toTopOf=\"parent\"\n    app:layout_constraintLeft_toLeftOf=\"parent\"\n    app:layout_constraintRight_toRightOf=\"parent\" /\u003e\n```\n\n```Kotlin\nvisualizer.ampNormalizer = { sqrt(it.toFloat()).toInt() }\n\nrecorder.apply {\n    onStop = { visualizer.clear() }\n    onAmpListener = {\n        runOnUiThread {\n            visualizer.addAmp(it)\n        }\n    }\n}\n```\n\n## Player\n```XML\n\u003ccom.imn.iivisu.PlayerVisualizer\n    android:id=\"@+id/visualizer\"\n    android:layout_width=\"0dp\"\n    android:layout_height=\"256dp\"\n    app:barWidth=\"3dp\"\n    app:spaceBetweenBar=\"2dp\"\n    app:approximateBarDuration=\"50\"\n    app:loadedBarPrimeColor=\"@color/primaryLight\"\n    app:backgroundBarPrimeColor=\"@color/gray\"\n    app:layout_constraintBottom_toTopOf=\"@id/timeline_text_view\"\n    app:layout_constraintTop_toTopOf=\"parent\"\n    app:layout_constraintLeft_toLeftOf=\"parent\"\n    app:layout_constraintRight_toRightOf=\"parent\" /\u003e\n```\n\n```Kotlin\nvisualizer.apply {\n    onStartSeeking = { player.pause() }\n    onSeeking = { timelineTextView.text = it.formatAsTime() }\n    onFinishedSeeking = { time, isPlayingBefore -\u003e\n        player.seekTo(time)\n        if (isPlayingBefore) {\n            player.resume()\n        }\n    onAnimateToPositionFinished = { time, isPlaying -\u003e\n            player.seekTo(time)\n        }\n    }\n}\n\nvisualizer.ampNormalizer = { sqrt(it.toFloat()).toInt() }\n\nplayer.onProgress = { time, isPlaying -\u003e\n    visualizer.updateTime(time.toInt(), isPlaying)\n}\n\nval amps = player.loadAmps()\nvisualizer.setWaveForm(amps, player.tickDuration)\n```\n\n# Documentation\n- `maxAmp`: Maximum amp that you expected to receive from the mic. Amps with higher than maxAmp are shown as a full height bar. This is calculated automatically in the `PlayerVisualizer`.\n\n- `barWidth`: Width of each bar.\n\n- `spaceBetweenBar`: Space between each bar.\n\n- `approximateBarDuration`: Defines approximate duration of each bar. The exact duration of each bar is calculated and stored in the `barDuration` variable.\n\n- `loadedBarPrimeColor`: Defines loaded bar color.\n\n- `backgroundBarPrimeColor`: Defines background (unloaded) bar color.\n\n- `ampNormalizer`: Receives a lambda method for normalizing amps. (for better visualization)\n\n- `addAmp`: Used for adding an amp to `RecorderVisualizer` and its bar gets drawn Immediately.\n\n- `setWaveForm`: Receives a list of integer `amps` and a `tickDuration` which defines the time per each amp.\n\n- `updateTime`: Used for updating `PlayerVisualizer` timeline to specified location. `isPlaying` param is used for defining behaviour of `onFinishedSeeking` callback.\n\n- `onStartSeeking` : Receives a callback for the action needed to happen when seeking starts.\n\n- `onSeeking` : Receives a callback for the action needed to happen during the seeking process and contains current time position of the visualizer.\n\n- `onFinishedSeeking`: Receives a callback for the action needed to happen after the seeking finishes and contains time position of the visualizer and a variable for deciding whether you need to resume player after seeking or not.\n\n- `seekOver(amount)`: Moves visualizer's cursor `amount` ahead/back and notifies using `onAnimateToPositionFinished` callback.\n\n- `seekTo(position)`: Moves visualizer's cursor to `position` and notifies using `onAnimateToPositionFinished` callback.\n\n- `onAnimateToPositionFinished`: Receives a callback for the action needed to happen after the moving to position finishes and contains time position of the visualizer and a variable for deciding whether you need to resume player after seeking or not.\n\n## License\nMIT. See the [LICENSE](https://github.com/ImnIrdst/iiVisu/blob/main/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImnIrdst%2FiiVisu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FImnIrdst%2FiiVisu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImnIrdst%2FiiVisu/lists"}