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

How to speak the distance of a place when you're pointing to it #42

Open
masilv4 opened this issue Feb 27, 2020 · 2 comments
Open

How to speak the distance of a place when you're pointing to it #42

masilv4 opened this issue Feb 27, 2020 · 2 comments
Labels
question Further information is requested

Comments

@masilv4
Copy link

masilv4 commented Feb 27, 2020

Hello, guys. I'm so glad that I've found this great library cause I'm in a project which uses AR and I have to add an accessibility feature for people with visual impairments. At the beginning, I'd like to make the app speaks (using TextToSpeech) the distance of a place when the user points to it. Is it possible? And if it is, how can I achieve that?

@gabrysgab
Copy link

You want the app to speak when user is clicking the label? You can try to implement
override fun onTouchEvent(event: MotionEvent?): Boolean in ArLabelView and check the coordinates of the touch with coordinates of a specific label and then handle the distance from the label in some text to speech logic (https://android-developers.googleblog.com/2009/09/introduction-to-text-to-speech-in.html) that you would also have to implement yourself. There are many ways in which you can achieve this. Unfortunately the library itself doesn't handle that specific case, it's only for displaying the destination labels with the distance.

@gabrysgab gabrysgab added the question Further information is requested label Mar 2, 2020
@masilv4
Copy link
Author

masilv4 commented Mar 3, 2020

Hi, gabrysgab.

No. I want the app speaks the distance of the label which is in the center of the screen when the user long click the screen. I know that in some cases two or more labels will be overlapping each other but I will handle this by speaking the distance of the most close to the current location.

I'm currently trying to implement a means of when the user long clicks the screen one function will be called to verify if the device's current azimuth is equal (not exactly, but in a range of 5 degrees) to some place's azimuth. If it is, the app will speak the distance of that place.

val currentDestinationAzimuth = (headingAngle - currentAzimuth + 360) % 360

When currentDestinationAzimuth is in the range of (-5, 5) degrees it means that I'm pointing to a place. I will do a for loop verifying this with all the places around, whenever occur a long click event.

I'm using the Krzysztof Jackowski's article as basis. See here: https://www.netguru.com/blog/augmented-reality-mobile-android

What do you think? Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants