Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

java - Converting recorded audio to text in android studio

I am making a custom keyboard app in which I want to add a microphone also. I want to record the audio and convert it to text. The tutorials available on the internet uses intent ( for calling another activity from the main activity). Since my app has no main activity, I am unable to use those tutorials for my code. I am able to record the audio in 3gp or mp3 format. I want to convert this to text. Could somebody please help me with this issue?

Recording audio:

        mic_key = new MediaRecorder();
        mic_key.setAudioSource(MediaRecorder.AudioSource.MIC);
        mic_key.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
        mic_key.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
        mic_key.setOutputFile(audio_file);
    private void speak()
    {
        try
        {
            mic_key.prepare();
            mic_key.start();
        } catch (IOException e) {
            e.printStackTrace();
        }
        Toast.makeText(EDMTKeyboard.this, "Recording Started", Toast.LENGTH_SHORT).show();
    }
    
    private void stop()
    {
        mic_key.stop();
        mic_key.release();


        Toast.makeText(EDMTKeyboard.this, "Recording Done", Toast.LENGTH_SHORT).show();
    }


question from:https://stackoverflow.com/questions/65886187/converting-recorded-audio-to-text-in-android-studio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...