-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInputNode.m
40 lines (29 loc) · 1 KB
/
InputNode.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
classdef InputNode < Node
methods
function obj = InputNode(pos,name,fcn)
global inputDevice;
global outputDevice;
global Fs;
global frameLength;
obj = obj@Node(pos,name,fcn); %Call parent constructor
inputDevice = audioDeviceReader(Fs, frameLength,'BitDepth','16-bit integer');
outputDevice = audioDeviceWriter( ...
'SampleRate',inputDevice.SampleRate);
end
function retrieveBuffer(obj)
global inputDevice;
%Get the input buffer here
dryBuffer = inputDevice();
%Pass it on
obj.applyEffect(dryBuffer);
end
function applyEffect(obj, buffer)
%disp(['Current Node: ', obj.Name]);
obj.passToNextNode(buffer);
end
function drag(obj)
end
function drop(obj)
end
end
end