Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Karan Goel
481-SoundBrain
Commits
59e85365
Commit
59e85365
authored
Jan 20, 2015
by
Karan Goel
Browse files
very basic sound modification
parent
948bd427
Changes
1
Hide whitespace changes
Inline
Side-by-side
final-app/public/js/app.js
View file @
59e85365
...
...
@@ -57,7 +57,8 @@ var SoundCloudAudioSource = function(player) {
// calculate an overall volume value
var
total
=
0
;
for
(
var
i
=
0
;
i
<
80
;
i
++
)
{
// get the volume from the first 80 bins, else it gets too loud with treble
total
+=
self
.
streamData
[
i
];
if
(
!
player
||
!
player
.
eegData
)
player
.
eegData
.
eegPower
=
self
.
streamData
[
i
];
total
+=
(
self
.
streamData
[
i
]
+
player
.
eegData
.
eegPower
.
beta
)
/
2
;
}
self
.
volume
=
total
;
};
...
...
@@ -594,10 +595,6 @@ window.onload = function init() {
var
socket
=
io
();
socket
.
on
(
'
data
'
,
function
(
data
)
{
console
.
log
(
data
);
});
var
visualizer
=
new
Visualizer
();
var
player
=
document
.
getElementById
(
'
player
'
);
var
uiUpdater
=
new
UiUpdater
();
...
...
@@ -623,6 +620,11 @@ window.onload = function init() {
audioSource
:
audioSource
});
socket
.
on
(
'
data
'
,
function
(
data
)
{
// console.log(data);
player
.
eegData
=
data
;
});
uiUpdater
.
toggleControlPanel
();
// on load, check to see if there is a track token in the URL, and if so, load that automatically
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment