Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All outputScores array values are 0, and result is "" #9

Open
FriedaSmith opened this issue Sep 13, 2020 · 0 comments
Open

All outputScores array values are 0, and result is "" #9

FriedaSmith opened this issue Sep 13, 2020 · 0 comments

Comments

@FriedaSmith
Copy link

Hello. I modified the code to recognize the 16kHz .wav file. The code to convert the audio file to the bytes array is as follows:

	String filepath = "G:\\Corpus\\North_Wind_and_the_Sun_passage\\M1\\nws_1.wav";
	ByteArrayOutputStream out = new ByteArrayOutputStream();
	BufferedInputStream in = new BufferedInputStream(new FileInputStream(filePath));
	int read;
	byte[] buff = new byte[1024];
	while ((read = in.read()) > 0) {
		out.write(buff, 0, read);

	}
	out.flush();
	byte[] audioBytes = out.toByteArray();
	System.out.println("audioBytes:" + audioBytes.length);
	return audioBytes;

	byte[] inputBuffer = new byte[RECORDING_LENGTH];
	System.arraycopy(audioBytes, 0, inputBuffer, 0, audioBytes.length);

However, all outputScores array values are 0, and result is "";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant