{"id":18397137,"url":"https://github.com/hecomi/umicrophonewebgl","last_synced_at":"2025-04-09T18:16:13.567Z","repository":{"id":216042474,"uuid":"740324254","full_name":"hecomi/uMicrophoneWebGL","owner":"hecomi","description":"Enable microphone input buffer access in Unity WebGL builds","archived":false,"fork":false,"pushed_at":"2024-11-30T14:26:29.000Z","size":69,"stargazers_count":46,"open_issues_count":5,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T18:16:09.572Z","etag":null,"topics":["microphone","unity","webgl"],"latest_commit_sha":null,"homepage":"https://tips.hecomi.com/entry/2024/01/28/010109","language":"C#","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/hecomi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-01-08T05:34:47.000Z","updated_at":"2025-04-09T10:39:17.000Z","dependencies_parsed_at":"2024-01-20T02:36:59.237Z","dependency_job_id":"9a6c4ab3-5896-4607-86eb-4cbd90a20b44","html_url":"https://github.com/hecomi/uMicrophoneWebGL","commit_stats":null,"previous_names":["hecomi/umicrophonewebgl"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecomi%2FuMicrophoneWebGL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecomi%2FuMicrophoneWebGL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecomi%2FuMicrophoneWebGL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecomi%2FuMicrophoneWebGL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hecomi","download_url":"https://codeload.github.com/hecomi/uMicrophoneWebGL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085322,"owners_count":21045139,"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":["microphone","unity","webgl"],"created_at":"2024-11-06T02:15:54.849Z","updated_at":"2025-04-09T18:16:13.548Z","avatar_url":"https://github.com/hecomi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"uMicrophoneWebGL\n================\n\n**uMicrophoneWebGL** enables microphone input buffer access in Unity WebGL builds.\n\n\n## Demo\n\n### Recorder\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hecomi/uMicrophoneWebGL/uMicrophoneWebGL-Recorder.gif\" width=\"640\" /\u003e\n\n### Waveform\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hecomi/uMicrophoneWebGL/uMicrophoneWebGL-Waveform.gif\" width=\"640\" /\u003e\n\n\n## Installation\n\n- **Unity Package**\n  - Download the latest .unitypackage from the [Release page](https://github.com/hecomi/uMicrophoneWebGL/releases).\n- **Git URL (UPM)**\n  - Add `https://github.com/hecomi/uMicrophoneWebGL.git#upm` to the Package Manager.\n- **Scoped Registry (UPM)**\n  - Add a scoped registry to your project.\n    - URL: `https://registry.npmjs.com`\n    - Scope: `com.hecomi`\n  - Install uMicrophoneWebGL in the Package Manager.\n\n\n## MicrophoneWebGL Component\n\nAttach `MicrophoneWebGL` component to a GameObject. Once attached, the following UI will be displayed:\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hecomi/uMicrophoneWebGL/uMicrophoneWebGL-UI.png\" width=\"640\" /\u003e\n\n- **Is Auto Start**\n  - When checked, data collection from the microphone starts automatically at launch.\n- **Devices**\n  - Called when a list of devices is constructed.\n  - Internally managed by indices (int).\n  - It's often unclear which device the user has selected, so it is advised to use this only for debugging purposes. Instead, provide a device selection UI at runtime, as demonstrated in the Recorder example.\n- **Events**\n  - Various events can be captured:\n  - **Ready Event**\n    - Called once after initialization on the JavaScript side and everything is ready.\n  - **Device List Event**\n    - Called when the device list is constructed.\n    - A list containing device information is passed as an argument.\n  - **Start Event**\n    - Called when a microphone starts.\n    - Internally, this corresponds to the completion of `navigator.mediaDevices.getUserMedia()`.\n  - **End Event**\n    - Called when a microphone stops.\n  - **Data Event**\n    - Called when microphone input buffer data is retrieved.\n    - An array of float waveform data is passed as an argument.\n\n## API Reference\n\n`MicrophoneWebGL` component provides the following properties and methods:\n\n### Variables / Properties\n\n- `bool isAutoStart`\n    - Corresponds to the Is Auto Start option in the UI. If true, the microphone starts automatically at launch.\n\n- `int micIndex`\n    - Index of the selected microphone device.\n\n- `TimingEvent readyEvent`\n    - Event triggered when the microphone is ready after initialization.\n\n- `TimingEvent startEvent`\n    - Event triggered when the microphone starts recording.\n\n- `TimingEvent stopEvent`\n    - Event triggered when the microphone stops recording.\n\n- `DeviceListEvent deviceListEvent`\n    - Event triggered when the list of available devices is updated.\n\n- `DataEvent dataEvent`\n    - Event triggered when microphone data is available.\n\n- `bool isValid { get; }`\n    - Indicates whether the microphone is in a valid state to be used.\n\n- `List\u003cDevice\u003e devices { get; }`\n    - List of available microphone devices.\n\n- `Device selectedDevice { get; }`\n    - Information about the currently selected microphone device.\n\n- `bool isRecording { get; }`\n    - Indicates whether the microphone is currently recording.\n\n### Methods\n\n- `void Begin()`\n    - Starts the microphone. Does nothing if the microphone is recording.\n\n- `void End()`\n    - Stops the microphone. Does nothing if the microphone is not recording.\n\n- `void RefreshDeviceList()`\n    - Refreshes the list of microphone devices. The Device List Event is triggered again at the end of the update.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhecomi%2Fumicrophonewebgl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhecomi%2Fumicrophonewebgl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhecomi%2Fumicrophonewebgl/lists"}