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

Saving and Retrieving recorded audio #66

Open
sheminnyoka opened this issue Apr 1, 2019 · 20 comments
Open

Saving and Retrieving recorded audio #66

sheminnyoka opened this issue Apr 1, 2019 · 20 comments

Comments

@sheminnyoka
Copy link

No description provided.

@Kaljurand
Copy link
Owner

What is the exact issue/request?

If you are interested in an activity that requests the audio together with its transcription then take a look at https://github.com/Kaljurand/K6nele/blob/master/app/src/main/java/ee/ioc/phon/android/speak/demo/ExtrasDemo.kt which uses https://github.com/Kaljurand/K6nele/blob/master/app/src/main/java/ee/ioc/phon/android/speak/activity/DetailsActivity.java to play the returned audio.

@sheminnyoka
Copy link
Author

I am calling speechactionactivity() from a button click, need to record this audio and i need to play this recorder audio in some other activity. I have gone through the code the above links but getting uri and audio . but trying to play only empty audio always.Your above 2 activity's code in kotlin,me working in java,audio file is empty always.While giving this code as put extra : intent.putExtra(Extras.EXTRA_GET_AUDIO_FORMAT, null as String?) , empty audio. I think need to provide some audio format which does not return null value, playing an audio with 0 duration .

@sheminnyoka
Copy link
Author

I am using only this speech recognition. I am having a button in first page ,when clicking that ,goes to
K6nele/app/src/main/java/ee/ioc/phon/android/speak/activity/SpeechActionActivity.java ,means I dont want google speech recognition . In SpeechActionActivity activty i needs uri and plays that audio in another page.

But I am gets stucked for palying this audio last week full ,i need to know whether i have to put put extra like this : in my first page button click
Intent i = new Intent(getContext(),SpeechActionActivity.class);
i.putExtra("android.speech.extra.GET_AUDIO", true);
i.putExtra("android.speech.extra.GET_AUDIO_FORMAT", (String)null);
Log.e("Success Demo","");
startActivityForResult(i, REQ_CODE_SPEECH_INPUT_FROM);

@Kaljurand
Copy link
Owner

Your intent construction looks OK to me. This is similar to what the ExtrasDemo does. You can set the format to "null" or "audio/wav". Kõnele only supports wav-recording.

Do you see any errors in the log when you read the audio URI? Maybe it's a permissions' issue?

@sheminnyoka
Copy link
Author

In ExtrasDemo , U are putting extras using speech intents from createrevognize intent function . In my case I don’t want Google Speech . So I directly use Intenting to SpeechAction Activity like above . I am Calling recording button from a fragment , on Intenting , not gets int OnActivityResult override function from fragment . Then able to set data from intent . I am not getting uri from intent . The important matter is I want to set data for getting audio uri from SpeechAction Activity or From fragment

@Kaljurand
Copy link
Owner

It's difficult to debug based on this info. Can you post your full code? Do you see anything suspicious in the log (adb logcat)?

@sheminnyoka
Copy link
Author

I will give you a link : https://we.tl/t-SRo2PhSuSR please download

@sheminnyoka
Copy link
Author

sheminnyoka commented Apr 3, 2019

If it is expired please use this : https://we.tl/t-pdc28A4UNF. In that I am using a fragment Home Fragment , on button click for recording , rather than for all
Speech recognisers , Knele Recognition only needs , U can check in HomeFragment n SpeechAction Activity . Can you please go through it how to get data from intent in my Code for audiouri and playing recorded audio in another activity

@sheminnyoka
Copy link
Author

sheminnyoka commented Apr 3, 2019

Will u please check it :
2019-04-04 10:33:08.027 18442-18442/ee.ioc.phon.android.speak E/details audio: content://ee.ioc.phon.android.speak.provider.FileContentProvider/audio.wav
2019-04-04 10:33:08.041 18442-18442/ee.ioc.phon.android.speak E/AudioFeatures: Application cannot support or Zenmode close
2019-04-04 10:33:08.068 18442-18442/ee.ioc.phon.android.speak E/duration: 0

In my testing phone, audio is not playing ,, audio duration is 0ms

my current scenario 👍

In Home Fragment , voice record button click , call the intent for knele Speech Recognition : Speech Recoginition Activity

In Speech Recognition
While Intenting , i have passed putextra audio and audio format and also provide set data

ScoreActivity : Playing audio : But here playing audio with 0 ms file which is same palying in Demo play inDemoActivity

Files_reference.zip

@sheminnyoka
Copy link
Author

In Your Extras Demo , while playing audio using uri from Details Activity , Getting audio but its not playing any audio there also . while toasting duration there , getting 0 ms .

@Kaljurand
Copy link
Owner

I briefly looked at your code, but there is a lot of it that is not relevant to this issue, so it was difficult to get an overview.

If I understand correctly, then you fail to hear any audio (and mMediaPlayer.getDuration() returns 0) when you use the Extras demo. Does this happen with an official Kõnele installation, or in your modified code? Does it happen with several devices / Android versions? I am not able to reproduce it on my devices...

In the log you are seeing "AudioFeatures: Application cannot support or Zenmode close". Can you further investigate if this could be the root of your issue.

Also, are you able to listen to the audio if you submit the intent and EXTRAs to Google's recognizer service?

@sheminnyoka
Copy link
Author

ZenMode Issue I will check,

Iam getting this error in samsung gt 19300 Android 4.3.3 !8 device

04-15 12:04:14.125 6737-6737/ee.ioc.phon.android.speak I/k6nele: onPartialResults: state = RECORDING
04-15 12:04:14.205 6737-6737/ee.ioc.phon.android.speak I/k6nele: onPartialResults: state = RECORDING
04-15 12:04:15.075 6737-6737/ee.ioc.phon.android.speak I/k6nele: onEndOfSpeech: state = RECORDING
04-15 12:04:15.660 6737-6737/ee.ioc.phon.android.speak I/k6nele: onPartialResults: state = TRANSCRIBING
04-15 12:04:15.755 6737-6737/ee.ioc.phon.android.speak I/k6nele: onResults: state = TRANSCRIBING
04-15 12:04:15.885 6737-6737/ee.ioc.phon.android.speak I/k6nele: onResults: results = [how are you is it ok is there anyone how are you is it ok is there anyone how are you, how are you is it ok is there anyone how are you is it ok is there how are you, how are you is it ok is there anyone how are you is it ok is there any how are you, how are you is it ok is there anyone how are you is it ok is there any one how are you, how are you is it ok is there anyone how are you is it ok is there and how are you]
04-15 12:04:15.925 6737-6737/ee.ioc.phon.android.speak I/dalvikvm: Could not find method android.media.MediaCodecList., referenced from method ee.ioc.phon.android.speechutils.utils.AudioUtils.getAvailableEncoders
04-15 12:04:15.925 6737-6737/ee.ioc.phon.android.speak W/dalvikvm: VFY: unable to resolve direct method 1264: Landroid/media/MediaCodecList;. (I)V
04-15 12:04:16.240 6737-6737/ee.ioc.phon.android.speak I/k6nele: onPause
04-15 12:04:16.260 6737-6737/ee.ioc.phon.android.speak W/TextToSpeech: shutdown failed: not bound to TTS engine
04-15 12:04:16.900 6737-6737/ee.ioc.phon.android.speak I/MediaPlayer: path is null
04-15 12:04:17.035 6737-6748/ee.ioc.phon.android.speak W/MediaPlayer: info/warning (973, 0)
04-15 12:04:17.280 6737-6737/ee.ioc.phon.android.speak I/MediaPlayer: Info (973,0)
04-15 12:04:17.280 6737-6737/ee.ioc.phon.android.speak I/MediaPlayer: Don't send intent. msg.arg1 = 0, msg.arg2 = 0

Whilw using google speech recognizer , saying as toast : an audio will sent to google to provide speech recognition service
Could you please tell which device you are running and getting audio ,kaarel please

@sheminnyoka
Copy link
Author

this issue happens in official konele documetation also

@sheminnyoka
Copy link
Author

just installed your app from playstore , same issue there

@Kaljurand
Copy link
Owner

It works at least in Android versions 7, 7.1, 9. I haven't used v4.3 for testing in the last years.

@sheminnyoka
Copy link
Author

Hi Kaarel,
its work in estonian i think , how its able to work in english , which recognitrion language i need to select .

@sheminnyoka
Copy link
Author

i need to work in english ?

@Kaljurand
Copy link
Owner

Using the service "Kõnele (fast recognition)" with an English recognition server should be discussed in another issue, for an existing discussion see #38

@sheminnyoka
Copy link
Author

how can we change default language to english first time itself dear

@sheminnyoka
Copy link
Author

audio with proper ms is getting when using only estonian language , when i change lanmguage to english , no audio with extra results is getting.

Changes need to get audio in english while language is in english

F

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

2 participants