1

I want to write a Voice Stress Analysis tool. I'm opening the audio stream for reading:

TargetDataLine line;
AudioFormat format = new AudioFormat((float) 44100, 16, 1, true, false);
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
line = (TargetDataLine) AudioSystem.getLine(info);
line.open(format);
// Begin audio capture.
line.start();

and then looping:

// Read the next chunk of data from the TargetDataLine.
numBytesRead = line.read(externalData, 0, externalData.length);

I get an array with bytes as externalData is defined as follows:

public static byte[] externalData = new byte[1024];

What I want to know is how to interpret this data? I tried to plot it by byte value, but I guess it's wrong. Plotted bytes

X axis is time and Y axis is byte value.

PS: Where can I find more information about McQuiston-Ford algorithm?

Mihail Burduja
  • 3,196
  • 2
  • 22
  • 28
  • possible duplicate of [Obtain wave pattern of a audio file in Java](http://stackoverflow.com/questions/13024683/obtain-wave-pattern-of-a-audio-file-in-java) – Peter O. Nov 04 '12 at 03:08

1 Answers1

2

You need to convert bytes into amplitude and plot those. See this question about how to dot it: Obtain wave pattern of a audio file in Java

as for the algorithm, wikipedia says its pseudescience, I doubt there's gonna be much about it in public domain.

Community
  • 1
  • 1
Denis Tulskiy
  • 19,012
  • 6
  • 50
  • 68
  • Measuring stress is possible, but using that information for lie detection is not scientifically proven. – Liam Sep 09 '13 at 13:54