コード例 #1
0
    private bool InitVoice()
    {
#if USING_GCLOUDVOICE && UNITY_EDITOR
        m_gcloudVoiceMan = new Gcloud_VoiceMan();
        bool ret = m_gcloudVoiceMan.Init();

        if (ret)
        {
            m_OffLineVoice = new Gcloud_OffLineVoice(this, VoiceMode.OffLine);

            m_RealTimeVoiceNational = new Gcloud_RealTimeVoiceNational(this, VoiceMode.RealTimeVoiceNational);

            m_RealTimeVoiceTeam = new Gcloud_RealTimeVoiceTeam(this, VoiceMode.RealTimeVoiceTeam);

            m_TranslationVoice = new Gcloud_TranslationVoice(this, VoiceMode.Translation);
        }
        return(ret);
#elif USING_LGVC
        m_lgvcVoiceMan = new GameObject("LGVC_VoiceMan").AddComponent <LGVC.LGVC_VoiceMan>();
        bool ret = m_lgvcVoiceMan.Init();

        if (ret)
        {
            m_OffLineVoice = new LGVC.LGVC_OffLineVoice(this, VoiceMode.OffLine);
        }

        return(ret);
#else
        return(false);
#endif
    }
コード例 #2
0
    public void TestPlayVoice()
    {
#if USING_GCLOUDVOICE && UNITY_EDITOR
        string path = Path.Combine(VoiceManager.Instance.VoiceDir, "1234-2def7ded-a621-47d4-8cbf-597c2587def0.wav");
        Gcloud_VoiceMan.PlayRecordedFile(path);
#elif USING_LGVC
        string path = Path.Combine(VoiceManager.Instance.VoiceDir, "1234-2def7ded-a621-47d4-8cbf-597c2587def0.wav");
        m_lgvcVoiceMan.PlayRecordedFile(path);
#endif
    }