import { Component, ViewChild } from '@angular/core'; import { TpAudioEditorComponent } from './tp-audio-editor/tp-audio-editor.component'; // Imports import { DataService } from './data-service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { @ViewChild(TpAudioEditorComponent) audioEditor: TpAudioEditorComponent; input: Blob; title = 'app'; constructor(private ds: DataService) { } clicked() { // Testing the get/set functionality on the component this.audioEditor.getBlob().then(blob => { this.input = blob; console.log("upload blob started.." + this.input.size) this.ds.uploadStream(18, blob).subscribe(); }, err => { console.error(err); }); } load() { this.ds.downloadStream(18).subscribe(prompt => { // var reader = new FileReader(); // reader.readAsArrayBuffer(prompt); this.input = new Blob([(prompt)], { type: "application/octect-stream" }); }); } }