Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top