보이스챗 둘러보기 포스트(https://photonkr.tistory.com/36?category=1054486)에 이어

보이스챗 적용하기를 해보겠습니다.

 

이번 시간에는 

PUN도 연동하여 프리팹을 생성하고

프리팹에 Photon Voice가 적용되어 보이스챗을 구현해보도록 하겠습니다.

 

 

 

Voice컨트롤러

: 하이라키에서 Create Empty를 이용해 빈 오브젝트 하나 생성 -> 이 오브젝트 이름을 VoiceController로 변경

 

1. 컴포넌트 추가

-Photon Voice Network 컴포넌트

-Recorder 컴포넌트

 

2. 컴포넌트 설정

2.1. Photon Voice Network 컴포넌트

Primary Recorder에 Voice 컨트롤러에 추가한 Recorder를 연결

2.2. Recorder 컴포넌트

Transmit Enabled 체크

Debug Echo 체크

 

Photon Voice Network 컴포넌트

 

Recorder 컴포넌트

 

 

프리팹 만들기

1. 큐브 생성

하이라키에서 3D Object를 이용해 그 중 Cube를 생성 

2. 큐브에 컴포넌트 추가

-PhotonView

-PhotonVoiceView

3. PhotonVoiceView 설정

-UsePrimaryRecorde 체크

-SetupDebugSpeake 체크

 

PUN 컨트롤러

1. 로비.룸 입장

-OnConnectedToMaster()

-PhotonNetwork.JoinRandomRoom()

2. 프리팹 인스턴스화 등등

-PhotonNetwork.Instantiate()

 

MatchMaker.cs
0.00MB

 

 

 

 

빌드 앤 런

1. 큐브 인스펙터

Speaker 컴포넌트가 자동 생성되어 마이크로폰으로 테스트 가능

 

 

 

 

* 최종 하이라키

 

 

참고로 PUN을 같이 사용안하고, 

Photon Voice2만 사용하셔도 됩니다.

 

 


 

Photon 공식 홈페이지 
https://www.photonengine.com/ko-kr/Photon


★Photon Help Center
https://support.photonengine.jp/hc/ko

 

 

★Photon Korea 공식 블로그
https://photonkr.tistory.com

 

 

★Photon Korea 페이스북

https://www.facebook.com/photoncloudkr

 

 

★Photon Korea 유투브

https://bitly.kr/photonyoutube

'Photon > Voice' 카테고리의 다른 글

[Photon Voice2] 보이스 챗 둘러보기  (1) 2019.06.18

안녕하세요~

이번 포스팅에서는 VR 개발시 

많이 이용하는 Voice를 같이 알아보려고 합니다.

 

* Unity Assets 다운로드&임포트

https://assetstore.unity.com/packages/tools/audio/photon-voice-2-130518

 

 

 

* App ID 설정하기

Photon Voice2를 다운로드&임포트를 하면

위와 같은 위자드가 뜹니다.

App ID나 Email을 준비하셨다면 바로 기입하시면 되고요.

 

조금 후에 설정하고 싶다면,

Assets\Photon\PhotonUnityNetworking에 위치한

PhotonServerSettings를 찾으시면 됩니다.

 

*데모를 살펴보면서 Voice를 하나씩 파악해볼까요?!

 

데모 위치

Assets\PhotonVoice\Demos\DemoVoicePun

씬 명

DemoVoicePUN-Scene

 

빌드&런 전

빌드&런 후

 

마이크로폰은 준비하셨죠?

바로 테스트는 확인이 안되고요.

InGame Settings에

Transmit, VoiceDetection, DebugEcho 

체크를 해주세요.

그러면 이제 테스트 가능합니다.

 

 

그리고 오른쪽 위 카메라 설정도 변경해보세요.

처음 시작은 Orthographic 이고요.

 

Third Person

 

First Person

 

카메라를 따라 사운드도 같이 변경되는 것을 확인할 수 있습니다.

 

 

핵심 컴포넌트 몇 개를 안내해드리겠습니다.

1. Photon Voice Network

PUN과 같이 사용한다면 꼭 필요한 컴포넌트로서, PUNVoice클라이언트 상태를 자동으로 싱크 맞춰주는 역할

2. Recorder

오디오 스트림을 전송하는 컴포넌트

3. Photon Voice View

PUN에 연결(네트워킹)하는 역할

 

 


 

 

Photon 공식 홈페이지 
https://www.photonengine.com/ko-kr/Photon


★Photon Help Center
https://support.photonengine.jp/hc/ko

 

 

★Photon Korea 공식 블로그
https://photonkr.tistory.com

 

 

★Photon Korea 페이스북

https://www.facebook.com/photoncloudkr

 

 

★Photon Korea 유투브

https://bitly.kr/photonyoutube

 

 

 

 

 

'Photon > Voice' 카테고리의 다른 글

[Photon Voice2]보이스 챗 적용하기  (0) 2019.07.14

<PUNs 비교>

2018년 8월 PUN2가 출시되었습니다.

업데이트 리스트는 아래 링크에서 확인할 수 있어요.

https://doc.photonengine.com/en-us/pun/current/getting-started/migration-notes

 

Migration Notes | Photon Engine

MULTIPLAYER REALTIME PUN BOLT QUANTUM COMMUNICATION CHAT VOICE SELF-HOSTED SERVER We Make Multiplayer Simple Photon Realtime Develop and launch multiplayer games globally whether you are an indie developer or AAA studio. Create synchronous or asynchronous

doc.photonengine.com

 

그 외 더 정리해서 포스팅합니다~

- Asset 다운로드, 임포트 (Classic 버전과 동일하게 Free 앱, Plus 앱 2종류가 있습니다.)

PUN 2 :

https://assetstore.unity.com/packages/tools/network/pun-2-free-119922

 

PUN 2 - FREE - Asset Store

Note: Contains breaking changes to existing PUN Classic (v1) projects. Please read our PUN 2 migration notes . In doubt: keep PUN Classic. Photon Unity Networking 2: NEW demos, cleaner API & structure, clear separation of PUN and Realtime API Export to all

assetstore.unity.com

https://assetstore.unity.com/packages/tools/network/photon-pun-2-120838

 

Photon PUN 2+ - Asset Store

Note: Contains breaking changes to existing PUN Classic (v1) projects. Please read our PUN 2 migration notes . In doubt: keep PUN Classic. Photon Unity Networking 2 - PLUS Version - includes 100 concurrent user Photon Cloud plan for 60 months NEW demos, cl

assetstore.unity.com

 

VS

PUN classic :

https://assetstore.unity.com/packages/tools/network/photon-unity-networking-classic-free-1786

 

Photon Unity Networking Classic - FREE - Asset Store

+++ New to Photon? please get the new PUN 2 package . +++ Already using PUN and not sure if you should switch to PUN 2 ? No worries, we will continue supporting PUN v1 as PUN Classic. If you are short before launch or already invested a lot of time in deve

assetstore.unity.com

https://assetstore.unity.com/packages/tools/network/photon-pun-classic-12080

 

Photon PUN+ Classic - Asset Store

+++ New to Photon? please get the new PUN 2+ package . +++ Already using PUN and not sure if you should switch to PUN 2+ ? No worries, we will continue supporting PUN v1 as PUN Classic and you can upgrade to PUN 2 for free at any time . If you are short be

assetstore.unity.com

 

 

 

 

- PhotonServerSettings

PUN 2 :

App Version필드 생성, Fixed Region은 직접 기입 등등

 

vs

PUN classic :

Hosting 선택, Auto-Join Lobby 선택 등등

 

 

 

-Connect to Master(Photon)

PUN 2 : PhotonNetwork.ConnectUsingSettings ()

vs

PUN classic : PhotonNetwork.ConnectUsingSettings ("[버전]")

 

 

 

-AutoJoinLobby

PUN 2 : 없음

vs

PUN classic : 존재

 

 

 

-콜백함수 사용하기 위해 부모 클래스 상속

PUN 2 : MonoBehaviourPunCallbacks

vs

PUN classic : PUN.MonoBehaviour or MonoBehaviour

 

콜백함수 예시

OnJoinedRoom()

OnJoinRandomFailed()

 

 

 

<PUN 2 업데이트>

- 새로운 데모, 샘플, 파일(디렉토리)

: Unity 2017.2018이후 버전 GUI 사용

- 직관적이고 명확해진 API, 프로그램 구조

: 'Photon' 루트 디렉토리에 정리된 소스

클래스, 콜백, 메소드 등이 리뉴얼

- 구별된 네임스페이스

: PUN, Realtime 레이어에 따라 구별된 API 코드

즉, Photon.PUN, Photon.Realtime

 

 

 

<PUN 2 구조>

- 최상위 레이어

: 네트워크 개체, RPC, 유니티 관련 부분

- 두번째 레이어

: Photon Server, 게이머 페어링 옵션, 통신 API(콜백)

- 세번째 레이어

: DLL(유니티 플러그인), 직렬화, 네트워크 프로토콜.패킷 

 

 

 


 

Photon 공식 홈페이지 
https://www.photonengine.com/ko-kr/Photon


★Photon Help Center
https://support.photonengine.jp/hc/ko

 

 

★Photon Korea 공식 블로그
https://photonkr.tistory.com

 

 

★Photon Korea 페이스북

https://www.facebook.com/photoncloudkr

 

 

★Photon Korea 유투브

https://bitly.kr/photonyoutube

 

'Photon > PUN' 카테고리의 다른 글

[PUN]유니티짱을 이용한 PUN2 시작하기  (0) 2019.07.21
[PUN] 매치메이킹  (0) 2019.04.24
[PUN]로비.룸 알아보기  (0) 2018.12.19
[PUN]RPC 알아보기  (0) 2018.12.10
[PUN]VR 프로젝트 구현하기  (0) 2018.07.22

+ Recent posts