Skip to content

Commit

Permalink
19 second Audio Recording Limit #160
Browse files Browse the repository at this point in the history
  • Loading branch information
emilt27 committed Jun 11, 2018
1 parent 9ea744d commit 25ebcf8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cors.staging.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"origin": ["https://cmuartfab.github.io", "http://localhost:3000"],
"origin": ["https://irllabs.github.io", "http://localhost:3000"],
"method": ["GET", "POST", "PUT", "DELETE"],
"maxAgeSeconds": 3600
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
</div>
<audio-recorder
*ngIf="showAudioRecorder()"
[maxRecordTime]="90"
(onRecorded)="onNarratorIntroRecorded($event)"
class="audio-editor__record-button room-editor__audio-record-button">
</audio-recorder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ <h2 class="hotspot-inspector__label">

<audio-recorder
*ngIf="showAudioRecorder()"
[maxRecordTime]="30"
(onRecorded)="onAudioRecorded($event)"
class="universal-editor__record-button">
</audio-recorder>
Expand Down
8 changes: 5 additions & 3 deletions src/ui/editor/util/audio-recorder/audio-recorder.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Component, EventEmitter, NgZone, Output, ViewChild } from '@angular/core';
import { Component, EventEmitter, Input, NgZone, Output, ViewChild } from '@angular/core';
import { generateUniqueId } from 'data/util/uuid';

import { AudioRecorderService } from 'ui/editor/util/audioRecorderService';
import { RoomProperty } from '../../../../data/scene/interfaces/roomProperty';

//this should really refer to colors inn our variables.scss file
const backgroundColorOff = new Uint8Array([173, 0, 52]); //i.e. $color-red-dark
const backgroundColorOn = new Uint8Array([255, 53, 113]); //i.e. $color-pink
const MAX_RECORDING_TIME = 20000; //20 seconds
const MAX_RECORDING_TIME = 20; //20 seconds

@Component({
selector: 'audio-recorder',
Expand All @@ -15,6 +16,7 @@ const MAX_RECORDING_TIME = 20000; //20 seconds
})
export class AudioRecorder {

@Input() maxRecordTime: number = MAX_RECORDING_TIME;
@Output() onRecorded = new EventEmitter();
@ViewChild('audioRecorder') audioRecorderButton;

Expand Down Expand Up @@ -58,7 +60,7 @@ export class AudioRecorder {
if (this.isRecording) {
this.stopRecording();
}
}, MAX_RECORDING_TIME);
}, this.maxRecordTime * 1000);
}

private stopRecording() {
Expand Down

0 comments on commit 25ebcf8

Please sign in to comment.