예제 #1
0
    protected virtual void StartCurSentence()
    {
        if (m_CurSentenceIndex >= CorePlayData.CurrentSong.NonRhythmSenteces.Count)
        {
            m_Status = Status.Finish;
            CorePlayManager.Instance.GameFinish();
            return;
        }

        m_CurrentStreamSentence = CorePlayData.CurrentSong.NonRhythmSenteces[m_CurSentenceIndex];
        m_CurSentenceLength     = m_CurrentStreamSentence.Duration;
        switch (m_CurrentStreamSentence.Type)
        {
        case SentenceType.NonRhythmCommon:
            m_Status = Status.Reading;

            PlayAudio();
            break;

        case SentenceType.NonRhythmVoice:
            m_Status = Status.WaitForSpeech;
            if (string.IsNullOrEmpty(m_CurrentStreamSentence.Speaker) == false)
            {
                AudioCategory ac          = AudioController.GetCategory("AudioWords");
                var           obj_speaker = ac.Play(m_CurrentStreamSentence.Speaker);
                obj_speaker.completelyPlayedDelegate = PlayNonRhythmVoice;
                m_Timer = 0;
            }
            else
            {
                PlayNonRhythmVoice();
            }
            break;
        }
    }
예제 #2
0
    void RepeatVoice(StreamSentence sentence)
    {
        m_Status = Status.RepeatingVoice;
        m_WaitingForRepeatFinish = true;
        CorePlayManager.Instance.ShowHorn();

        if (m_AudioRepeatList.Count > 0)
        {
            // 暂时不支持拼字
            AudioCategory ac  = AudioController.GetCategory("AudioWords");
            var           obj = ac.Play(m_AudioRepeatList[0]);
            //LogManager.Log ("play : " , m_AudioRepeatList[0]);

            if (obj != null)
            {
                obj.completelyPlayedDelegate = (v) => {
                    MicManager.Instance.Play(sentence.needRecord, RepeatVoiceFinish, sentence.Sentence[0].Key);
                };
            }
        }
        else
        {
            MicManager.Instance.Play(sentence.needRecord, RepeatVoiceFinish, sentence.Sentence[0].Key);
        }
    }
예제 #3
0
    private void PlayWordFor(AudioObject obj = null)
    {
        CreateTapSentence();
        AudioCategory ac = AudioController.GetCategory("AudioWords");

        ac.Play(m_CurrentStreamSentence.FileName);
        //LogManager.Log ("PlayWordFor : " , m_CurrentStreamSentence.FileName);
    }
예제 #4
0
    protected void PlayAudio()
    {
        AudioCategory ac = AudioController.GetCategory("AudioWords");

        if (string.IsNullOrEmpty(m_CurrentStreamSentence.Speaker) == false)
        {
            //LogManager.Log ("  m_CurrentStreamSentence.Speaker = " , m_CurrentStreamSentence.Speaker);
            var obj_speaker = ac.Play(m_CurrentStreamSentence.Speaker);
            obj_speaker.completelyPlayedDelegate = PlayWordFor;
        }
        else
        {
            PlayWordFor();
        }
        m_AudioRepeatList.Add(m_CurrentStreamSentence.FileName);
    }