Commit 39b983305f0b0acb8d3c746adf36d48dbf98a8a4
1 parent
8222cfc9
Exists in
master
and in
8 other branches
Orientacao fixada em retrado. Txt do plugin de voz adicionado
Showing
5 changed files
with
250 additions
and
28 deletions
Show diff stats
Assets/Scenes/Main.unity
| ... | ... | @@ -525,7 +525,15 @@ Prefab: |
| 525 | 525 | - target: {fileID: 11466268, guid: 6506218ed7927bf45b508ebbec0c1222, type: 2} |
| 526 | 526 | propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target |
| 527 | 527 | value: |
| 528 | - objectReference: {fileID: 578311380} | |
| 528 | + objectReference: {fileID: 578311381} | |
| 529 | + - target: {fileID: 11466268, guid: 6506218ed7927bf45b508ebbec0c1222, type: 2} | |
| 530 | + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName | |
| 531 | + value: callVoiceRecognizer | |
| 532 | + objectReference: {fileID: 0} | |
| 533 | + - target: {fileID: 11466268, guid: 6506218ed7927bf45b508ebbec0c1222, type: 2} | |
| 534 | + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName | |
| 535 | + value: UnityEngine.Object, UnityEngine | |
| 536 | + objectReference: {fileID: 0} | |
| 529 | 537 | m_RemovedComponents: [] |
| 530 | 538 | m_ParentPrefab: {fileID: 100100000, guid: 6506218ed7927bf45b508ebbec0c1222, type: 2} |
| 531 | 539 | m_IsPrefabParent: 0 |
| ... | ... | @@ -536,6 +544,10 @@ Prefab: |
| 536 | 544 | m_Modification: |
| 537 | 545 | m_TransformParent: {fileID: 0} |
| 538 | 546 | m_Modifications: |
| 547 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 548 | + propertyPath: m_Animations.Array.size | |
| 549 | + value: 40 | |
| 550 | + objectReference: {fileID: 0} | |
| 539 | 551 | - target: {fileID: 491010, guid: 00197fc9877daa14c963e5917de36124, type: 2} |
| 540 | 552 | propertyPath: m_LocalPosition.x |
| 541 | 553 | value: 0 |
| ... | ... | @@ -592,6 +604,174 @@ Prefab: |
| 592 | 604 | propertyPath: m_Center.z |
| 593 | 605 | value: -1.45801504e-08 |
| 594 | 606 | objectReference: {fileID: 0} |
| 607 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 608 | + propertyPath: m_Animation | |
| 609 | + value: | |
| 610 | + objectReference: {fileID: 7400000, guid: d1bd20c609a57d8408f7c651c3dbb275, type: 2} | |
| 611 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 612 | + propertyPath: m_Animations.Array.data[40] | |
| 613 | + value: | |
| 614 | + objectReference: {fileID: 7400000, guid: 89457731942262c4f81ddf864d48eada, type: 2} | |
| 615 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 616 | + propertyPath: m_Animations.Array.data[0] | |
| 617 | + value: | |
| 618 | + objectReference: {fileID: 7400000, guid: 89457731942262c4f81ddf864d48eada, type: 2} | |
| 619 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 620 | + propertyPath: m_Animations.Array.data[1] | |
| 621 | + value: | |
| 622 | + objectReference: {fileID: 7400000, guid: aba4ebb4f2c1d1c48b482c4389ca9402, type: 2} | |
| 623 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 624 | + propertyPath: m_Animations.Array.data[2] | |
| 625 | + value: | |
| 626 | + objectReference: {fileID: 7400000, guid: 1720f6b05f29fb449bcad3651b3f40cc, type: 2} | |
| 627 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 628 | + propertyPath: m_Animations.Array.data[3] | |
| 629 | + value: | |
| 630 | + objectReference: {fileID: 7400000, guid: ff372f002622cb440852aeae6813089c, type: 2} | |
| 631 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 632 | + propertyPath: m_Animations.Array.data[4] | |
| 633 | + value: | |
| 634 | + objectReference: {fileID: 7400000, guid: 00cacafc7d617df408370ed500935368, type: 2} | |
| 635 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 636 | + propertyPath: m_Animations.Array.data[5] | |
| 637 | + value: | |
| 638 | + objectReference: {fileID: 7400000, guid: 17ea4efa9d951d14991b276a5af0fb26, type: 2} | |
| 639 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 640 | + propertyPath: m_Animations.Array.data[6] | |
| 641 | + value: | |
| 642 | + objectReference: {fileID: 7400000, guid: 4c588ba833de9e7499ba381d978f5d83, type: 2} | |
| 643 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 644 | + propertyPath: m_Animations.Array.data[7] | |
| 645 | + value: | |
| 646 | + objectReference: {fileID: 7400000, guid: bc68a4fd90591944c94b8b1b4719c666, type: 2} | |
| 647 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 648 | + propertyPath: m_Animations.Array.data[8] | |
| 649 | + value: | |
| 650 | + objectReference: {fileID: 7400000, guid: 5f016d4a195d7694a8d4015db4811c86, type: 2} | |
| 651 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 652 | + propertyPath: m_Animations.Array.data[9] | |
| 653 | + value: | |
| 654 | + objectReference: {fileID: 7400000, guid: 23077937e2ee04a4c8ae9d20df262957, type: 2} | |
| 655 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 656 | + propertyPath: m_Animations.Array.data[10] | |
| 657 | + value: | |
| 658 | + objectReference: {fileID: 7400000, guid: 4ef528c573b442e4db3424874cba3fe0, type: 2} | |
| 659 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 660 | + propertyPath: m_Animations.Array.data[11] | |
| 661 | + value: | |
| 662 | + objectReference: {fileID: 7400000, guid: d1bd20c609a57d8408f7c651c3dbb275, type: 2} | |
| 663 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 664 | + propertyPath: m_Animations.Array.data[12] | |
| 665 | + value: | |
| 666 | + objectReference: {fileID: 7400000, guid: 3482c0ae2b16aee4b8aedb1756ba8c9a, type: 2} | |
| 667 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 668 | + propertyPath: m_Animations.Array.data[13] | |
| 669 | + value: | |
| 670 | + objectReference: {fileID: 7400000, guid: b964dd8530e1719479b4af6e42677e87, type: 2} | |
| 671 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 672 | + propertyPath: m_Animations.Array.data[14] | |
| 673 | + value: | |
| 674 | + objectReference: {fileID: 7400000, guid: 97f0060e88e991749baf8573e9dff6a0, type: 2} | |
| 675 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 676 | + propertyPath: m_Animations.Array.data[15] | |
| 677 | + value: | |
| 678 | + objectReference: {fileID: 7400000, guid: 31af19923b41b424c843d4f2e01d515d, type: 2} | |
| 679 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 680 | + propertyPath: m_Animations.Array.data[16] | |
| 681 | + value: | |
| 682 | + objectReference: {fileID: 7400000, guid: 725c5e8e8a3a1d147bbf51642238b8b0, type: 2} | |
| 683 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 684 | + propertyPath: m_Animations.Array.data[17] | |
| 685 | + value: | |
| 686 | + objectReference: {fileID: 7400000, guid: fc46bcda25831724d81ffd6bfb90feb0, type: 2} | |
| 687 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 688 | + propertyPath: m_Animations.Array.data[18] | |
| 689 | + value: | |
| 690 | + objectReference: {fileID: 7400000, guid: fc898e47d6ffce04c9501b6b7179bf36, type: 2} | |
| 691 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 692 | + propertyPath: m_Animations.Array.data[19] | |
| 693 | + value: | |
| 694 | + objectReference: {fileID: 7400000, guid: 6e16176b3b2034e4e81e76938a091265, type: 2} | |
| 695 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 696 | + propertyPath: m_Animations.Array.data[20] | |
| 697 | + value: | |
| 698 | + objectReference: {fileID: 7400000, guid: d192f4fdfb5cab64a915bcff4c0ee422, type: 2} | |
| 699 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 700 | + propertyPath: m_Animations.Array.data[21] | |
| 701 | + value: | |
| 702 | + objectReference: {fileID: 7400000, guid: 07f51d1178056794d95279cb4583cceb, type: 2} | |
| 703 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 704 | + propertyPath: m_Animations.Array.data[22] | |
| 705 | + value: | |
| 706 | + objectReference: {fileID: 7400000, guid: b2dc77c38f72740418eead23625b9ef2, type: 2} | |
| 707 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 708 | + propertyPath: m_Animations.Array.data[23] | |
| 709 | + value: | |
| 710 | + objectReference: {fileID: 7400000, guid: c71a57593e53c5a46ae511089a3664c3, type: 2} | |
| 711 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 712 | + propertyPath: m_Animations.Array.data[24] | |
| 713 | + value: | |
| 714 | + objectReference: {fileID: 7400000, guid: 731776140c9a51740ace1422431969d7, type: 2} | |
| 715 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 716 | + propertyPath: m_Animations.Array.data[25] | |
| 717 | + value: | |
| 718 | + objectReference: {fileID: 7400000, guid: 44fde49e82d8cd54f8c06f92fb0e628d, type: 2} | |
| 719 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 720 | + propertyPath: m_Animations.Array.data[26] | |
| 721 | + value: | |
| 722 | + objectReference: {fileID: 7400000, guid: c6f150fd4c1e02743a78dcc2d9a40c9d, type: 2} | |
| 723 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 724 | + propertyPath: m_Animations.Array.data[27] | |
| 725 | + value: | |
| 726 | + objectReference: {fileID: 7400000, guid: 8655f1ac4c173e442b9460a62a628a45, type: 2} | |
| 727 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 728 | + propertyPath: m_Animations.Array.data[28] | |
| 729 | + value: | |
| 730 | + objectReference: {fileID: 7400000, guid: 3663a385e61b20b498b7d70a21e3841f, type: 2} | |
| 731 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 732 | + propertyPath: m_Animations.Array.data[29] | |
| 733 | + value: | |
| 734 | + objectReference: {fileID: 7400000, guid: d356552118ed06940a695ab179f1cd5f, type: 2} | |
| 735 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 736 | + propertyPath: m_Animations.Array.data[30] | |
| 737 | + value: | |
| 738 | + objectReference: {fileID: 7400000, guid: 8415cb4e63f28f845bd1fba975cd35be, type: 2} | |
| 739 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 740 | + propertyPath: m_Animations.Array.data[31] | |
| 741 | + value: | |
| 742 | + objectReference: {fileID: 7400000, guid: 95e28371bf9685a48ae2ccec1d32e1f1, type: 2} | |
| 743 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 744 | + propertyPath: m_Animations.Array.data[32] | |
| 745 | + value: | |
| 746 | + objectReference: {fileID: 7400000, guid: 8b474cf9ba48d31449b051b5ec72d79b, type: 2} | |
| 747 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 748 | + propertyPath: m_Animations.Array.data[33] | |
| 749 | + value: | |
| 750 | + objectReference: {fileID: 7400000, guid: a74f27d391e6c034bbcb774b7e1a1a11, type: 2} | |
| 751 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 752 | + propertyPath: m_Animations.Array.data[34] | |
| 753 | + value: | |
| 754 | + objectReference: {fileID: 7400000, guid: 0e5fe34d018fed14788c3ccbcbdf94bd, type: 2} | |
| 755 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 756 | + propertyPath: m_Animations.Array.data[35] | |
| 757 | + value: | |
| 758 | + objectReference: {fileID: 7400000, guid: ebd4fa98b34a23a408b684c5d9dfb39e, type: 2} | |
| 759 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 760 | + propertyPath: m_Animations.Array.data[36] | |
| 761 | + value: | |
| 762 | + objectReference: {fileID: 7400000, guid: 04ccc2f86152d764ea9162476d997291, type: 2} | |
| 763 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 764 | + propertyPath: m_Animations.Array.data[37] | |
| 765 | + value: | |
| 766 | + objectReference: {fileID: 7400000, guid: c61ac94817ee33e49ba7c26faa2b922f, type: 2} | |
| 767 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 768 | + propertyPath: m_Animations.Array.data[38] | |
| 769 | + value: | |
| 770 | + objectReference: {fileID: 7400000, guid: bf1df9e5177fe844892ce68033127c3f, type: 2} | |
| 771 | + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2} | |
| 772 | + propertyPath: m_Animations.Array.data[39] | |
| 773 | + value: | |
| 774 | + objectReference: {fileID: 7400000, guid: 4f943c1381cd5bd4181b0f2493ae4bd2, type: 2} | |
| 595 | 775 | m_RemovedComponents: [] |
| 596 | 776 | m_ParentPrefab: {fileID: 100100000, guid: 00197fc9877daa14c963e5917de36124, type: 2} |
| 597 | 777 | m_IsPrefabParent: 0 | ... | ... |
| ... | ... | @@ -0,0 +1,59 @@ |
| 1 | +/********************** | |
| 2 | + ********LAVID********** | |
| 3 | + ***VLibras Project***** | |
| 4 | + * | |
| 5 | + * This works as a plugin for unity. | |
| 6 | + * It needs to be exported (exportJar) | |
| 7 | + * | |
| 8 | + * Calls Google Speech API | |
| 9 | + * | |
| 10 | + * Author: Claudiomar Araujo | |
| 11 | + * claudiomar.araujo@lavid.ufpb.br | |
| 12 | + * */ | |
| 13 | + | |
| 14 | +package com.lavid.vlibrasdroid; | |
| 15 | + | |
| 16 | +import android.content.Intent; | |
| 17 | +import android.speech.RecognizerIntent; | |
| 18 | +import com.unity3d.player.UnityPlayerActivity; | |
| 19 | +import java.util.ArrayList; | |
| 20 | +import java.util.concurrent.Semaphore; | |
| 21 | + | |
| 22 | +public class MainActivity extends UnityPlayerActivity{ | |
| 23 | + | |
| 24 | + private static final int REQUEST_OK = 1; | |
| 25 | + private static String recordedAudio = ""; | |
| 26 | + private Semaphore s = new Semaphore(0); | |
| 27 | + | |
| 28 | + // Calls Google Voice Recognizer and returns "" or some recognized string | |
| 29 | + public String callGoogleSpeech() { | |
| 30 | + recordedAudio = ""; | |
| 31 | + try { | |
| 32 | + Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); | |
| 33 | + i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "pt-BR"); | |
| 34 | + startActivityForResult(i, REQUEST_OK); | |
| 35 | + } catch (Exception e) { | |
| 36 | + //Toast.makeText(this, "Error initializing speech to text engine.", Toast.LENGTH_LONG).show(); | |
| 37 | + } | |
| 38 | + try { | |
| 39 | + s.acquire(); // waits for onActivityResult | |
| 40 | + } catch (InterruptedException e) { | |
| 41 | + e.printStackTrace(); | |
| 42 | + } | |
| 43 | + return recordedAudio; // returns to unity | |
| 44 | + } | |
| 45 | + | |
| 46 | + @Override | |
| 47 | + protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
| 48 | + super.onActivityResult(requestCode, resultCode, data); | |
| 49 | + | |
| 50 | + // If voice recording is ok | |
| 51 | + if (requestCode==REQUEST_OK && resultCode==RESULT_OK) { | |
| 52 | + ArrayList<String> thingsYouSaid = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); | |
| 53 | + recordedAudio = thingsYouSaid.get(0); | |
| 54 | + } | |
| 55 | + // Releases callGoogleSpeech method whether audio is captured or not | |
| 56 | + s.release(); | |
| 57 | + } | |
| 58 | + | |
| 59 | +} | ... | ... |
Assets/Scripts/GenericPlayerManager.cs
| ... | ... | @@ -89,6 +89,7 @@ public abstract class GenericPlayerManager : MonoBehaviour { |
| 89 | 89 | |
| 90 | 90 | public virtual void Start() |
| 91 | 91 | { |
| 92 | + Screen.orientation = ScreenOrientation.Portrait; | |
| 92 | 93 | AVATAR = GameObject.FindGameObjectWithTag("avatar");//referencia para o avatar |
| 93 | 94 | COMPONENT_ANIMATION = AVATAR.GetComponent<Animation>();//referencia para o componente animador do avatar |
| 94 | 95 | AVATAR_COLLIDER = GameObject.FindGameObjectWithTag("avatar").GetComponent<BoxCollider>(); | ... | ... |
Assets/Scripts/PlayerManager.cs
| ... | ... | @@ -13,15 +13,12 @@ using UnityEngine.UI; |
| 13 | 13 | |
| 14 | 14 | public class PlayerManager : GenericPlayerManager { |
| 15 | 15 | |
| 16 | -#if UNITY_EDITOR | |
| 17 | - private const string BASE_URL = "http://150.165.205.9/anims/ANDROID/"; | |
| 18 | -#endif | |
| 19 | 16 | |
| 20 | 17 | #if UNITY_IPHONE && !UNITY_EDITOR |
| 21 | 18 | private const string BASE_URL = "http://150.165.205.9/anims/IOS/"; |
| 22 | 19 | #endif |
| 23 | 20 | |
| 24 | -#if UNITY_ANDROID && !UNITY_EDITOR | |
| 21 | +#if UNITY_ANDROID | |
| 25 | 22 | private const string BASE_URL = "http://150.165.205.9/anims/ANDROID/"; |
| 26 | 23 | #endif |
| 27 | 24 | private const string SERVER_URL = "http://vlibras.lavid.ufpb.br/glosa?texto="; |
| ... | ... | @@ -95,29 +92,6 @@ public class PlayerManager : GenericPlayerManager { |
| 95 | 92 | } |
| 96 | 93 | } |
| 97 | 94 | |
| 98 | - /*protected string getGlosaFromServer(string str) | |
| 99 | - { | |
| 100 | - string strToServer = ""; | |
| 101 | - | |
| 102 | - foreach (char c in str) | |
| 103 | - if (c.Equals(' ')) | |
| 104 | - strToServer += "%20"; | |
| 105 | - else | |
| 106 | - strToServer += c; | |
| 107 | - | |
| 108 | - Debug.Log("str to server -> " + strToServer); | |
| 109 | - | |
| 110 | - string urlWithText = SERVER_URL + strToServer; | |
| 111 | - | |
| 112 | - WWW www = new WWW(urlWithText); | |
| 113 | - StartCoroutine(waitForRequest(www)); | |
| 114 | - | |
| 115 | - // while(!www.isDone) Thread.Sleep(250); | |
| 116 | - | |
| 117 | - Debug.Log("returned from server -> " + www.text); | |
| 118 | - return www.text; | |
| 119 | - }*/ | |
| 120 | - | |
| 121 | 95 | protected IEnumerator waitForRequest(WWW www) |
| 122 | 96 | { |
| 123 | 97 | yield return www.isDone; | ... | ... |