An open API service indexing awesome lists of open source software.

https://github.com/developeracademy-postech/2024-nc2-m4-push_to_talk

Apple Developer Academy 3rd Morning Session NC2 Pair4(Arthur&Keenie)'s Push to Talk
https://github.com/developeracademy-postech/2024-nc2-m4-push_to_talk

Last synced: about 1 month ago
JSON representation

Apple Developer Academy 3rd Morning Session NC2 Pair4(Arthur&Keenie)'s Push to Talk

Awesome Lists containing this project

README

        

# 2024-NC2-M4-Push_to_Talk
Apple Developer Academy 3rd Morning Session NC2
Pair4(Arthur&Keenie)'s Push to Talk

**TTBBANGBBANG๐Ÿš˜**

## ๐ŸŽฅ Youtube Link
(์ถ”ํ›„ ๋งŒ๋“ค์–ด์ง„ ์œ ํŠœ๋ธŒ ๋งํฌ ์ถ”๊ฐ€)

## ๐Ÿ’ก About Push To Talk

### Push To Talk์ด๋ž€?
**iOS์˜ ์˜ค๋””์˜ค ์ปค๋ฎค๋‹ˆ์ผ€์ด์…˜ class**๋กœ iOS ์•ฑ์—์„œ ์›Œํ‚คํ† ํ‚ค ํ†ต์‹ ์„ ํ†ตํ•ด
๋น ๋ฅธ ์ปค๋ฎค๋‹ˆ์ผ€์ด์…˜ ์ง„ํ–‰ํ•˜๋„๋ก ๋„์™€์ฃผ๋Š” Framework (๋ฌด์ „๊ธฐย ๊ธฐ๋Šฅ)
(watchOS5.3, iOS16 ์ด์ƒ๋ถ€ํ„ฐ ์‚ฌ์šฉ ๊ฐ€๋Šฅ)

### Push To Talk์˜ ๊ธฐ๋Šฅ
* ์‹ค์‹œ๊ฐ„์œผ๋กœ ์ •๋ณด ๊ณต์œ ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค
* ๊ฐ™์€ ์ฑ„๋„์— ์žˆ๋Š” ์ฐธ๊ฐ€์ž๋“ค์—๊ฒŒ ๋™์‹œ์— ์ •๋ณด ์ „๋‹ฌ์ด ๊ฐ€๋Šฅํ•˜๋‹ค
* ๋ฐฑ๊ทธ๋ผ์šด๋“œ์—์„œ ์‹คํ–‰ํ•˜๊ณ  ์žˆ์–ด๋„ ๋ฐฐํ„ฐ๋ฆฌ ์†Œ๋ชจ๊ฐ€ ์ ๋‹ค
* ์—ฌ๋Ÿฌ ๋ช…์ด ์ฑ„๋„์— ์žˆ์„ ์‹œ ํ•œ ๋ฒˆ์— ํ•œ ์ฐธ๊ฐ€์ž๋งŒ ๋งํ•  ์ˆ˜ ์žˆ๋‹ค.
* ์–ด๋–ค ์ฐธ๊ฐ€์ž๊ฐ€ ์ด์•ผ๊ธฐ๋ฅผ ํ•˜๊ณ  ์žˆ๊ณ , ์–ด๋–ค ์ฐธ๊ฐ€์ž๊ฐ€ ๋“ฃ๊ณ  ์žˆ๋Š”์ง€ ๋ณด์—ฌ์ฃผ์–ด์•ผ ํ•œ๋‹ค.
* ์•ฑ ์‹คํ–‰ ์‹œ ๋งˆ์ดํฌ ์ ‘๊ทผ ๊ถŒํ•œ์— ๋Œ€ํ•œ ํ—ˆ์šฉ์„ ์š”์ฒญํ•ด์•ผ ํ•œ๋‹ค.

## ๐ŸŽฏ What we focus on?
PushToTalk์„ ์ด์šฉํ•˜๋ฉด ์ฑ„๋„ ๋‚ด์— ์žˆ๋Š” ์‚ฌ์šฉ์ž๋“ค๊ณผ ๊ฐ„๋‹จํ•˜๊ฒŒ ์†Œํ†ต์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ๋ฐฑ๊ทธ๋ผ์šด๋“œ์—์„œ ์†Œ๋ชจ๋˜๊ณ  ์žˆ์–ด๋„ ๋ฐฐํ„ฐ๋ฆฌ ์†Œ๋ชจ๊ฐ€ ์ ๊ณ  ์ฆ‰๊ฐ์ ์ธ ์ •๋ณด์ „๋‹ฌ๊ณผ ์Šต๋“์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

## ๐Ÿ’ผ Use Case
๋งค์ผ ์นดํ’€์„ ํ•˜๋Š” ๊ทธ๋ฃน์˜ ๊ตฌ์„ฑ์›๋“ค๋ผ๋ฆฌ ์นดํ’€ ์ „ ์‰ฝ๊ฒŒ ์‹ค์‹œ๊ฐ„ ์ •๋ณด(๋„์ฐฉ์‹œ๊ฐ„๊ณผ ์œ„์น˜)๋ฅผ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ์ž.

## ๐Ÿ–ผ๏ธ Prototype

![NC2 Act แ„‹แ…กแ„‰แ…ฅandแ„แ…ตแ„‚แ…ต 001](https://github.com/DeveloperAcademy-POSTECH/2024-NC2-M4-Push_to_Talk/assets/166780563/597306a8-fd9f-4ab1-b261-13b5e9ecf44e)
![NC2 Act แ„‹แ…กแ„‰แ…ฅandแ„แ…ตแ„‚แ…ต 002](https://github.com/DeveloperAcademy-POSTECH/2024-NC2-M4-Push_to_Talk/assets/166780563/e341ef03-c1b5-401f-b802-7e7c12ccd928)

## ๐Ÿ› ๏ธ About Code
##### PTT Channel Manager & Channel UUID & Channel Descriptor ์„ ์–ธ
```
var channelManager: PTChannelManager!

let channelUUID = UUID()

let channelDescriptor = PTChannelDescriptor(name: "Channel Name", image: UIImage(systemName: "person"))
```
##### PTT Channel Manager ์„ค์ •
```
channelManager = try await PTChannelManager.channelManager(delegate: self, restorationDelegate: self)
```
##### Channel ์ฐธ๊ฐ€ ์š”์ฒญ ๋ฉ”์„œ๋“œ
```
channelManager.requestJoinChannel(channelUUID: channelUUID, descriptor: channelDescriptor)
```
##### Channel ์˜ค๋””์˜ค ์ „์†ก ์š”์ฒญ ๋ฉ”์„œ๋“œ
```
channelManager.requestBeginTransmitting(channelUUID: channelUUID)
```
##### Channel ์˜ค๋””์˜ค ์ „์†ก ๋ฉ”์„œ๋“œ์˜ ํ˜ธ์ถœ์ด ์„ฑ๊ณต์ ์ด์—ˆ์„ ๋•Œ, ์ฝœ๋ฐฑ๋˜๋Š” ๋ฉ”์„œ๋“œ
```
func channelManager(_ channelManager: PTChannelManager,
channelUUID: UUID,
didBeginTransmittingFrom source: PTChannelTransmitRequestSource) {

}
```
##### ์˜ค๋””์˜ค์˜ ํ™œ์„ฑํ™”๋˜์—ˆ์„ ๋•Œ, ์ฝœ๋ฐฑ๋˜๋Š” ๋ฉ”์„œ๋“œ
```
func channelManager(_ channelManager: PTChannelManager,
didActivate audioSession: AVAudioSession) {

}
```
##### ์„œ๋ฒ„์—์„œ PTT Notification์„ ๋ฐ›์•˜์„ ๋•Œ(๋‹ค๋ฅธ ์œ ์ €์˜ Audio๋ฅผ ๋ฐ›์•˜์„ ๋•Œ), ์ฝœ๋ฐฑ๋˜๋Š” ๋ฉ”์„œ๋“œ
```
func incomingPushResult(channelManager: PTChannelManager, channelUUID: UUID, pushPayload: [String : Any]) -> PTPushResult {

let activeSpeakerName = pushPayload[โ€œactiveSpeakerโ€]
let activeSpeakerImage = getActiveSpeakerImage(name: activeSpeakerName)
return .activeRemoteParticipant(PTParticipant(name: activeSpeakerName,
image: activeSpeakerImage))
}
```