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

Problem reading .3gp files #180

Open
noellemorris opened this issue Mar 25, 2022 · 2 comments
Open

Problem reading .3gp files #180

noellemorris opened this issue Mar 25, 2022 · 2 comments

Comments

@noellemorris
Copy link

Hi,

I'm attempting to adapt the File recognition code to files I record with Android's MediaRecorder class, and I'm having trouble getting it to work with code something like the following:

File outputDir = application.getFilesDir();
String fileName = "TEST.3gp" 

File audioFile = new File(outputDir + File.separator + fileName);

if (!audioFile.exists()) return;

Then I pass it to the sample code's recognizeFile method with:

InputStream ais = new FileInputStream(audioFile);

But the results in my callbacks are always empty. Is .3gp not supported by SpeechStreamService? If not, what file formats are supported? Or is there something else I'm doing wrong? (I never get an IOException, just empty hypothesis strings in the callbacks.)

@nshmyrev
Copy link
Collaborator

Is .3gp not supported by SpeechStreamService?

No, you have to transcode.

If not, what file formats are supported?

Only raw PCM data.

@noellemorris
Copy link
Author

Thank you for the quick response! I do have some additional questions:

If not, what file formats are supported?

Only raw PCM data.

Could you explain what you mean by this? Because your this sample app uses a .wav from the assets folder:

InputStream ais = getAssets().open(
"10001-90210-01803.wav");

So I'd like to understand why that works, if only raw PCM data is supported.

Thanks!

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

No branches or pull requests

2 participants