{"id":13692221,"url":"https://github.com/math3ussdl/Plugin.Maui.AudioRecorder","last_synced_at":"2025-05-02T19:31:39.840Z","repository":{"id":157501448,"uuid":"633487472","full_name":"math3ussdl/Plugin.Maui.AudioRecorder","owner":"math3ussdl","description":"This plugin provides functionality to record audio and transcribe spoken text into written format in real-time, while saving the audio file. It is designed for use with .NET Multi-platform App UI (MAUI) framework.","archived":false,"fork":false,"pushed_at":"2023-05-09T19:25:06.000Z","size":27,"stargazers_count":11,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T17:13:32.851Z","etag":null,"topics":["android","audio","audio-processing","ios","macos","maui","tizen","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/math3ussdl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2023-04-27T15:52:03.000Z","updated_at":"2024-03-28T16:52:36.000Z","dependencies_parsed_at":"2024-04-08T02:16:14.872Z","dependency_job_id":"259f1943-6327-4ab4-9212-c7c32f4335fc","html_url":"https://github.com/math3ussdl/Plugin.Maui.AudioRecorder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math3ussdl%2FPlugin.Maui.AudioRecorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math3ussdl%2FPlugin.Maui.AudioRecorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math3ussdl%2FPlugin.Maui.AudioRecorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math3ussdl%2FPlugin.Maui.AudioRecorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/math3ussdl","download_url":"https://codeload.github.com/math3ussdl/Plugin.Maui.AudioRecorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224328529,"owners_count":17293274,"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","audio","audio-processing","ios","macos","maui","tizen","windows"],"created_at":"2024-08-02T17:00:54.947Z","updated_at":"2024-11-12T18:30:28.670Z","avatar_url":"https://github.com/math3ussdl.png","language":"C#","funding_links":[],"categories":["Plugins"],"sub_categories":[],"readme":"# Plugin.Maui.AudioRecorder\n\n## Overview\nThis plugin provides functionality to record audio and transcribe spoken text into written format in real-time, while saving the audio file. It is designed for use with .NET Multi-platform App UI (MAUI) framework.\n\n## Features\n* Record audio from device microphone\n* Real-time transcription of spoken text to written format\n* Ability to save the audio file with transcription\n\n## Installation\n1 - Install the NuGet package ```Plugin.Maui.AudioRecorder``` \u003cbr/\u003e\n2 - In your .NET MAUI project, add the following using statement to ```MauiProgram.cs``` file to use this plugin: \u003cbr /\u003e\n```csharp\nusing Plugin.Maui.AudioRecorder;\n```\n3 - Add this plugin to the ```MauiApp``` pipeline: \u003cbr /\u003e\n```csharp\nbuilder\n  // ...\n  .UseAudioRecorder()\n  // ...\n```\n4 - Enjoy it!\n\n## Usage\n## Inject the Audio service\nFirst of all, you must inject the ```IAudioRecorder``` service, remembering that in this example we will consider a class that uses MVVM with the CommunityToolkit.Mvvm module.\n```csharp\nusing CommunityToolkit.Mvvm.ComponentModel;\nusing Plugin.Maui.AudioRecorder;\n\nnamespace MyAwesomeProject.ViewModels;\n\n[ObservableObject]\npublic partial class RecordingPageViewModel\n{\n  private readonly IAudioRecorder _audioRecorderService;\n\n  public RecordingPageViewModel(IAudioRecorder audioRecorderService)\n  {\n    _audioRecorderService = audioRecorderService;\n  }\n\n  [ObservableProperty]\n  private bool isRecording;\n\n  // ...\n}\n```\nIf you prefer, you can call the instance as follows:\n```csharp\nvar audioRecorderService = Services.GetService(typeof(IAudioRecorder)) as IAudioRecorder;\n\n// ...\n```\n\n### Start Recording\nTo start the recording we offer the ```StartRecordAsync``` method, which can be called in two ways:\n\n* \u003cstrong\u003eWithout parameters\u003c/strong\u003e: In this way we only save the audio in the chosen path, i.e. we do not transcribe the audio for you.\n```csharp\n[RelayCommand]\nprivate async void HandleRecord()\n{\n  // Setting the path of the file\n  _audioRecorderService.FilePath = Path.Combine(\"/storage/emulated/0/Download\", fileName);\n\n  await audioService.StartRecordAsync();\n}\n```\n\n* \u003cstrong\u003eWith parameters\u003c/strong\u003e: If you want us to return to you, in addition to saving the audio, the transcribed text, you will need to pass three arguments to this method: An ```CultureInfo``` instance so we know what language your input audio will be, an ```IProgress``` instance, so you decide how the text will be processed, and a ```CancellationToken```, standard for asynchronous methods.\n```csharp\n[RelayCommand]\nprivate async void HandleRecord()\n{\n  // Setting the path of the file\n  _audioRecorderService.FilePath = Path.Combine(\"/storage/emulated/0/Download\", fileName);\n\n  await _audioService.StartRecordAsync(\n    CultureInfo.GetCultureInfo(\"en-us\"),\n    new Progress\u003cstring\u003e(partialText =\u003e\n    {\n      // ...\n    }),\n    CancellationToken.None,\n  );\n}\n```\n\n### Stop Recording\nTo stop the recording we offer the ```StopRecordAsync``` method:\n```csharp\n[RelayCommand]\nprivate async void HandleStopRecord()\n{\n  // will returns a Audio instance!\n  var audio = await _audioService.StopRecordAsync();\n}\n```\n\n## Limitations\n* Transcription accuracy may vary depending on factors such as background noise, speaker accent, and speech speed.\n* This plugin only works on android. If you want, you can add support for other platforms via PRs.\n\n## License\nThis plugin is released under the GNU AFFERO GENERAL PUBLIC License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmath3ussdl%2FPlugin.Maui.AudioRecorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmath3ussdl%2FPlugin.Maui.AudioRecorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmath3ussdl%2FPlugin.Maui.AudioRecorder/lists"}