// 再生状態の変更 private void UpdatePlaying() { // 前回と状態が変わっていないなら無処理 if (_isPlaying == _reqPlaying) { return; } // 再生要求 if (_reqPlaying) { OggCall.COggEncodSetting(2, _sampleRate, 0.1f); if (_read == null) { _read = new OggCall.OnEncodeRead(this.OnEncodeRead); } if (_write == null) { _write = new OggCall.OnEncodeWrite(this.OnEncodeWrite); } if (OggCall.COggEncodBegin(_read, _write) == 0) { Debug.Log("初期化エラー"); _reqPlaying = false; return; } } // 停止要求 else { OggCall.COggEncodClose(); } _isPlaying = _reqPlaying; }