[npm bump] audio floor beat, split audioanalyser to separate entity

This commit is contained in:
Kevin Ngo
2018-09-25 05:58:16 -07:00
parent 0061a781a4
commit 9e75eefc43
6 changed files with 32 additions and 18 deletions

View File

@@ -12,6 +12,7 @@ AFRAME.registerComponent('audio-columns', {
dependencies: ['audioanalyser'],
schema: {
analyser: {type: 'selector', default: '#audioanalyser'},
height: {default: 1.0},
mirror: {default: 3},
scale: {default: 4.0},
@@ -20,7 +21,7 @@ AFRAME.registerComponent('audio-columns', {
},
init: function () {
this.analyser = this.el.components.audioanalyser;
this.analyser = this.data.analyser.components.audioanalyser;
// Number of levels is half the FFT size.
this.frequencyBinCount = this.analyser.data.fftSize / 2;

View File

@@ -161,8 +161,8 @@ AFRAME.registerComponent('song-preview-system', {
},
updateAnalyser: function () {
document.getElementById('audioAnalyser').setAttribute('audioanalyser', 'src', this.audio);
document.getElementById('introSong').pause();
document.getElementById('audioColumns').setAttribute('audioanalyser', 'src', this.audio);
},
/**