ngx-wavesurfer-rxjs
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

WaveSurfer RxJS

Angular service that provides RxJS observables for most of the standard WaveSurfer.js events, plus other useful observables.

Demos

Usage

Documentation is on the way, but something along the lines of ...

import { NgxWavesurferService } from 'ngx-wavesurfer';
import {
  WaveSurferRxJSEventObservables,
  WaveSurferRxJSEventSubscriptions,
} from '../interfaces';
import { WaveSurferRxJSService } from '../wsrxjs.service';

@Component({
  selector: 'app-wave-surfer-rx-js',
  templateUrl: './wave-surfer-rx-js.component.html',
  styleUrls: ['./wave-surfer-rx-js.component.scss'],
})
export class WaveSurferRxJSComponent implements OnInit {
  wave: WaveSurfer;
  waveSurferRxJS: WaveSurferRxJSEventObservables = {};

  constructor(
    public waveService: NgxWavesurferService,
    public waveSurferRxJSService: WaveSurferRxJSService
  ) {}
  ngOnInit() {
    this.wave = this.waveService.create({
      container: '#basetemplate',
    });
    this.waveSurferRxJS = this.waveSurferRxJSService.getRxJSWave(this.wave);
    this.wave.load(
      '//www.kennethcaple.com/api/mp3/richinlovemutedguitarechoing.mp3'
    );

  }
  stop() {
    this.wave.stop();
    this.waveSurferRxJSService.stop();
  }
  ngOnDestroy(): void {
    this.waveSurferRxJSService.unsubscribeAll();
  }
}

Package Sidebar

Install

npm i ngx-wavesurfer-rxjs

Weekly Downloads

1

Version

1.0.1

License

BSD-3-Clause

Unpacked Size

76.6 kB

Total Files

19

Last publish

Collaborators

  • kennethcaple