Coder Social home page Coder Social logo

Comments (20)

Kaljurand avatar Kaljurand commented on August 26, 2024 1

@ismtlee This toast is not generated by Kõnele, but by an external app that one can (optionally) use via Kõnele. It is not possible to suppress toasts generated by external apps, unless of course they offer an API for doing so.

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #1 originally posted by Kaljurand on 2014-11-19T23:13:48.000Z:

v0.8.44 supports audio/wav

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #2 originally posted by Kaljurand on 2014-12-10T11:52:29.000Z:

Please provide the support of these extras!

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #3 originally posted by Kaljurand on 2014-12-10T12:39:44.000Z:

Hey...are you able to save the wav formatted audio? if yes then how?

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #4 originally posted by Kaljurand on 2014-12-10T13:58:41.000Z:

@pavan.kirusa

See this Stackoverflow answer for how to get the audio data out of the result intent: http://stackoverflow.com/a/24404235/12547

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #5 originally posted by Kaljurand on 2014-12-10T14:04:03.000Z:

Using that code my demo app is not launching the Google search's microphone prompt

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #6 originally posted by Kaljurand on 2014-12-10T14:05:36.000Z:

I was trying same code but by putting these extras my demo app is not even launching the Google search's microphone prompt. Does it need any kind of permissions apart from Record Audio...?

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #7 originally posted by Kaljurand on 2014-12-10T14:20:01.000Z:

Thanks man I'm able to receive the AMR format..but as you have mentioned above about the audio/wav format....I'm trying that and its not working

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #8 originally posted by Kaljurand on 2014-12-10T14:21:30.000Z:

Thanks man I'm able to receive the AMR format..but as you have mentioned above about the audio/wav format....I'm trying that and its not working..are you able to receive the wav formatted audio?

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #9 originally posted by Kaljurand on 2014-12-10T19:01:30.000Z:

@pavan.kirusa Currently, Kõnele does not return AMR, but WAV. If your question is not about Kõnele, then please use another forum. If it is then please post the code that is not working, and I can take a closer look.

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #10 originally posted by Kaljurand on 2014-12-11T09:04:22.000Z:

I'm running the code you suggested through the stackoverflow answer using Konele as the input for voice with only one change AMR to WAV

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

Comment #11 originally posted by Kaljurand on 2014-12-13T23:47:54.000Z:

@pavan.kirusa

See the ExtrasDemo in the Kõnele settings, and the corresponding source code. It gets the audio URI by calling getData() on the resulting intent. You just have to save the data referenced by this URI.

from k6nele.

tungdsv avatar tungdsv commented on August 26, 2024

Hello,
I used SpeechRecognizer to not show Google microphone but i can't get audio record. I try many methods to capture audio but all of them are not successful.
So, How I can get result text and audio without show Google microphone?
Thanks!

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

@tungdsv can you post some code to add more detail to your question?

from k6nele.

tungdsv avatar tungdsv commented on August 26, 2024

@Kaljurand
My goal is capture audio and text from speech to text but not show Google microphone popup.
This is my code using SpeechRecognizer.

private void onRecordAudioPermissionGranted(Context context) {
        try {
            intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
            intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language);
            intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, language);
            intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, language);
            intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, language);
            intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true); // For streaming result
            intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, timeout);
            intent.putExtra("android.speech.extra.GET_AUDIO_FORMAT", "audio/AMR");
            intent.putExtra("android.speech.extra.GET_AUDIO", true);

            recognizer = SpeechRecognizer.createSpeechRecognizer(context);
            recognizer.setRecognitionListener(this);
            recognizer.startListening(intent);

        } catch (Exception exc) {
            if (mSpeechCallback != null) {
                mSpeechCallback.onError(exc.getMessage());
            }
        }
    }

And this above code I can't get audio from RecognitionListener.
After, I use MediaRecorder or AudioRecord to record audio when startlistenning(). However, whenever start recording, SpeechRecogziner immediately return result is empty and finish listenning.
I tried using SpeechReconginze in activity and recorder in thread or service but same result. Then using SpeechRecognize in thread or service and Recorder in activity but same result.
If i use the below code, i can capture text and audio from OnAcitivtyResult but it show Google Microphone popup:

Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getPackageName());
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, language);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, language);
        intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, language);
        intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true); // For streaming result
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, timeout);
        intent.putExtra("android.speech.extra.GET_AUDIO_FORMAT", "audio/AMR");
        intent.putExtra("android.speech.extra.GET_AUDIO", true);
        try {
            startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
        } catch (ActivityNotFoundException a) {
            Toast.makeText(getApplicationContext(),
                    getString(R.string.speech_not_supported),
                    Toast.LENGTH_SHORT).show();
        }

But this is not my goal.
Could you help me or suggest for me a solution?
Thank you!

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

@tungdsv I don't know how the Google service returns audio. This is out of the scope of the Kõnele project. You should ask Google.

from k6nele.

tungdsv avatar tungdsv commented on August 26, 2024

@Kaljurand
Thank you!
So, the Kõnele project allow capture audio and text from speech to text?

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

@tungdsv Kõnele can be used as a front-end to 3rd party speech-to-text services. It depends on these services if they return the audio as well, or just text. However, Kõnele also comes with its own services ("grammar support" and "fast recognition"), and they return the audio (as wav), try it out in "Developer settings ... -> Extras demo". (This issue is about adding AMR support.)

from k6nele.

tungdsv avatar tungdsv commented on August 26, 2024

@Kaljurand
I download project and run app. In extra demo, in chat demo, I see when speech to text no dialog shown.
My question is I can get audio (wav) in chat demo?
If can, how i can capture audio?
Thanks!

from k6nele.

Kaljurand avatar Kaljurand commented on August 26, 2024

You would need to implement the onBufferReceived-callback and hope that the service fills the buffer with the actual audio:

        @Override
        public void onBufferReceived(byte[] buffer) {
            // save the buffer for later
        }

See e.g.

from k6nele.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.