voice-capture
v0.0.45
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.2.0.
Downloads
76
Readme
VoiceCapture
This library was generated with Angular CLI version 18.2.0.
Build
Run ng build voice-capture
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build voice-capture
, go to the dist folder cd dist/voice-capture
and run npm publish
.
How to use
- Import the following items from package in your component
import { VoiceCaptureComponent } from 'voice-capture'; import { AudioStreamingService } from 'voice-capture'; import { ConfigurationsService } from 'voice-capture';
- Update the component where you use this
//app.component.ts export class AppComponent { title = 'sample-angular'; audioURLL: string | null = null; private configService = inject(ConfigurationsService);
constructor( private audioStreamingService: AudioStreamingService, private cd: ChangeDetectorRef ) { this.configService.setSilenceConfig({ MINIMUM_SILENCE_DURATION: 20 }); // to set value other than default value : 10 this.configService.setBlobConfig({ MINIMUM_BLOB_SIZE: 200001 }); // to set value other than default value : 200000 this.configService.setThresholdConfig({ SILENCE_THRESHOLD: 0.006 }); // to set value other than default value : 0.005 }
ngOnInit() { this.audioStreamingService.audioBlob$.subscribe(async (blob) => { console.log('Blob size===' + blob.size); if (blob.size > this.configService.getBlobConstant) { this.audioURLL = window.URL.createObjectURL(blob); console.log('Filename::' + this.audioURLL); this.audioPlayer.nativeElement.src = this.audioURLL; this.cd.detectChanges(); } }); } }
- Add below code to the html
//app.component.html
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
Code maintained by: Praveen E P