Mercurial > hg > human-echolocation-java-webapp
comparison webapp/WEB-INF/src/TestEchoClass.java @ 8:76f809129f98
build file now correctly compiling the TestEchoClass; the TestEchoClass now calls the matlab function with the output filename arg.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 29 Nov 2013 13:04:29 +0000 |
parents | ac4aa1922f32 |
children | 1eb7ec525d3c |
comparison
equal
deleted
inserted
replaced
7:81cbea09cc75 | 8:76f809129f98 |
---|---|
18 HumanEcho echo; | 18 HumanEcho echo; |
19 | 19 |
20 try { | 20 try { |
21 echo = new HumanEcho(); | 21 echo = new HumanEcho(); |
22 | 22 |
23 // Matlab structure: | |
24 // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2, 'outputfname', 'foo.wav') | |
23 | 25 |
24 // Matlab structure: | 26 String[] InputStructFields = {"dist", "azim", "orient", "dirweight", "outputfname"}; |
25 // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2) | |
26 | |
27 String[] InputStructFields = {"dist", "azim", "orient", "dirweight"}; | |
28 Input = new MWStructArray(1, 1, InputStructFields); | 27 Input = new MWStructArray(1, 1, InputStructFields); |
29 Input.set("dist", 1, Double.valueOf(0.9)); | 28 Input.set("dist", 1, Double.valueOf(0.9)); |
30 Input.set("azim", 1, Double.valueOf(0)); | 29 Input.set("azim", 1, Double.valueOf(0)); |
31 Input.set("orient", 1, "horz"); | 30 Input.set("orient", 1, "horz"); |
32 Input.set("dirweight", 1, Double.valueOf(0.2)); | 31 Input.set("dirweight", 1, Double.valueOf(0.2)); |
32 Input.set("outputfname", 1, "yeah.wav"); | |
33 | |
33 | 34 |
34 Object[] result = echo.simulateBinauralSignals(Input); | 35 Object[] result = echo.simulateBinauralSignals(Input); |
35 | 36 |
36 MWNumericArray array = (MWNumericArray)result[0]; | 37 // MWNumericArray array = (MWNumericArray)result[0]; |
37 //square = (double[][])array.toArray(); | 38 // square = (double[][])array.toArray(); |
38 | 39 |
39 } | 40 } |
40 catch(MWException e) { | 41 catch(MWException e) { |
41 e.printStackTrace(); | 42 e.printStackTrace(); |
42 } | 43 } |