Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/angular-a11y/voicecapture-angular


https://github.com/angular-a11y/voicecapture-angular

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# voicecapture-angular

`voicecapture-angular` is an Angular library designed to provide seamless voice capture and transcription capabilities for web applications. With an easy-to-use API, `voicecapture-angular` allows developers to integrate voice recognition features effortlessly, enabling users to interact with applications using their voice. The library offers customizable options for handling voice input and transcription, making it a flexible solution for enhancing user interfaces.

## Installation

To install `voicecapture-angular`, run the following command:

```bash
npm install voicecapture-angular
```

## Usage Example

```typescript
import { Component } from '@angular/core';
import { signal, WritableSignal } from 'signals';
import { VoiceCapture } from 'voicecapture-angular';

@Component({
selector: 'app-voicecapture-example',
templateUrl: './voicecapture-example.component.html',
})
export class VoiceCaptureExampleComponent {
isVoiceCaptureExample: WritableSignal = signal(false);
voiceTextTranscript!: string;

openVoiceCapture() {
this.isVoiceCaptureExample.set(true);
}

returnVoiceTranscript(transcript: string) {
this.voiceTextTranscript = transcript;
}
}
```

### HTML Template

```html

Open VoiceCapture Example

@if(voiceTextTranscript) {

Transcript Results


{{ voiceTextTranscript }}


Input Example:

Textarea Example:


{{ voiceTextTranscript }}

}
```

## Component Setup

In the `VoiceCaptureExampleComponent`, a `WritableSignal` named `isVoiceCaptureExample` is defined, initialized to `false`. The `openVoiceCapture` method sets `isVoiceCaptureExample` to `true`, which triggers the voice capture process.

## Inputs

### @Input() start: WritableSignal

Controls the initiation of voice capture.

### @Input() lang: string = 'en'

Language of voice capture, this default is en.

### @Input() mode: string = 'fullscreen'

Mode of voice capture, this default is `fullscreen` other value `float`.

**Example**: Start capturing voice input.

```html

```

### Outputs

### (voiceTranscript)

An event that emits the transcribed voice input.

**Example**: Capture and use the transcribed text.

```typescript
returnVoiceTranscript(transcript: string) {
this.voiceTextTranscript = transcript;
}
```

## Features

- **Real-time Voice Transcription**: Instantly capture and display voice input as text.
- **Editable Transcripts**: Users can modify the transcribed text through input fields or text areas.
- **Customizable Events**: Easily handle transcription results with customizable output events.