Fermata icon indicating copy to clipboard operation
Fermata copied to clipboard

Featured request voice message

Open fcaronte opened this issue 3 years ago • 12 comments

Hi Dev, I would to know if you can add the possibility to send a voice message on WhatsApp and Telegram using their web service. Send text and other things seem working correctly. Need to can move the menu button from bottom right side because is the same position of the mic button

fcaronte avatar Oct 25 '21 16:10 fcaronte

Do you mean the floating button? You can move it - long press and move the button.

AndreyPavlenko avatar Oct 25 '21 16:10 AndreyPavlenko

Ok thank for suggestions, I never try to move 🤣 I try on Android auto emulator and voice message seem to work, I can try tomorrow on my car to confirm. Another question, can the keyboard opened only manually? Every were I move on WhatsApp web site it open keyboard

fcaronte avatar Oct 25 '21 16:10 fcaronte

Unfortunately, no. It's opened automatically once a text field gains focus.

AndreyPavlenko avatar Oct 25 '21 17:10 AndreyPavlenko

Understand, and so this keyboard is the standard from Android auto? No way to add a mic button for the voice to text feature?

fcaronte avatar Oct 25 '21 20:10 fcaronte

Since version 1.8.5 there is such feature, but it does not work for web forms. I'll try to implement in the next version.

AndreyPavlenko avatar Oct 25 '21 21:10 AndreyPavlenko

Since 1.8.6 voice input (if enabled in settings) is activated along with AA text input.

AndreyPavlenko avatar Oct 31 '21 22:10 AndreyPavlenko

@AndreyPavlenko yeah is working, the only things is layout is difficult to see because is under the keyboard but I don't know if you have possibly to fix o maybe simple move a little up or make as a long rettangle and use the side space. IMG_20211105_073359

fcaronte avatar Nov 05 '21 06:11 fcaronte

@AndreyPavlenko do you think something like that can be used to avoid keyboard to self opening when you use voice input? Maybe show keyboard after voice input is closed and maybe with a button on it to force touch keyboard to be open.

https://stackoverflow.com/questions/10636635/disable-keyboard-on-edittext

fcaronte avatar Nov 20 '21 12:11 fcaronte

@stevendevit good job with the youtube background trick, I would to ask you another question. I would to improve the keyboard/voice input to avoid to be as on picture before. pratically i want to keep keyboard closed when is showing the voice input method and if you don't say nothing popup will close and then open keyboard. i try to do a lot of try but i'm not able to undestand how to detect when popup is closed due to "not detected speak" seem to be manage by error catch but i can't get correctly. i was able to keep keyboard closed but can't launch an "open" because i don't have the no voice input flag

MainCarActivity

public EditText startInput(TextWatcher w) {
		if (editText == null) editText = new CarEditText(this);
		if (textWatcher != null) editText.removeTextChangedListener(textWatcher);
		editText.addTextChangedListener(w);
		textWatcher = w;
		a().startInput(editText);  
		getActivityDelegate().onSuccess(a -> {
			if (!a.getPrefs().getVoiceControlEnabledPref()) return; 
			a.startSpeechRecognizer().onSuccess(q -> {
				editText.setText(q.get(0));
				stopInput();
			});
		});
		return editText;
	}

I lost my try due to my pc problem and so i don't remember exaclty what i try. pratically we need to remove the first "a().startInput(editText); " and use "if no text detect". pleas try to give a check. I'm use whatsapp web and without self keyboard opening experience will be improve a lot

fcaronte avatar Nov 26 '21 17:11 fcaronte

MainActivityDelegate

@Override
		public void onError(int error) {
			String msg = "Speech recognition failed with error code " + error;
			Log.e(msg);
			
			promise.completeExceptionally(new IOException(msg));
			hideActiveMenu();
			if (error == SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS) {
				showAlert(getContext(), R.string.err_no_audio_record_perm);
			}
		}

From the log i can see on "no word detect" it get error = 7 so we neeed to manage this as a flag for showing the keyboard

fcaronte avatar Nov 26 '21 17:11 fcaronte

@stevendevit good job with the youtube background trick, I would to ask you another question. I would to improve the keyboard/voice input to avoid to be as on picture before. pratically i want to keep keyboard closed when is showing the voice input method and if you don't say nothing popup will close and then open keyboard. i try to do a lot of try but i'm not able to undestand how to detect when popup is closed due to "not detected speak" seem to be manage by error catch but i can't get correctly. i was able to keep keyboard closed but can't launch an "open" because i don't have the no voice input flag

MainCarActivity

public EditText startInput(TextWatcher w) {
		if (editText == null) editText = new CarEditText(this);
		if (textWatcher != null) editText.removeTextChangedListener(textWatcher);
		editText.addTextChangedListener(w);
		textWatcher = w;
		a().startInput(editText);  
		getActivityDelegate().onSuccess(a -> {
			if (!a.getPrefs().getVoiceControlEnabledPref()) return; 
			a.startSpeechRecognizer().onSuccess(q -> {
				editText.setText(q.get(0));
				stopInput();
			});
		});
		return editText;
	}

I lost my try due to my pc problem and so i don't remember exaclty what i try. pratically we need to remove the first "a().startInput(editText); " and use "if no text detect". pleas try to give a check. I'm use whatsapp web and without self keyboard opening experience will be improve a lot

Yeah that would improve a lot the experience. I'll look onto it when in my free time.

stevendevit avatar Nov 27 '21 10:11 stevendevit

Here is where I found the log about "no word detection" popup will close with "error = 7" I try to check in error=7 do something on the other class but I was able to get only a force close 🤣

https://github.com/AndreyPavlenko/Fermata/blob/6b4f17d4f43614fd9240cecf2a3962e79dbd559a/fermata/src/main/java/me/aap/fermata/ui/activity/MainActivityDelegate.java

@Override
		public void onError(int error) {
			String msg = "Speech recognition failed with error code " + error;
			Log.e(msg);
			promise.completeExceptionally(new IOException(msg));
			hideActiveMenu();
			if (error == SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS) {
				showAlert(getContext(), R.string.err_no_audio_record_perm);
			}
		}
 

fcaronte avatar Nov 28 '21 09:11 fcaronte