> For the complete documentation index, see [llms.txt](https://melod-it.gitbook.io/sagwa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://melod-it.gitbook.io/sagwa/media/avfoundation/system-audio-interaction/avaudiosession/avaudiosession.mode.md).

# AVAudioSession.Mode

> 원문 출처\
> <https://developer.apple.com/documentation/avfoundation/avaudiosession/mode>

## Declaration

{% tabs %}
{% tab title="Swift" %}

```swift
struct Mode
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
typedef NSString *AVAudioSessionMode;
```

{% endtab %}
{% endtabs %}

## Summary

> **SDKs**
>
> * iOS 12.0+
> * macOS 10.15+
> * Mac Catalyst 13.0+
> * tvOS 12.0+
> * watchOS 5.0+

> **Framework**
>
> * AVFoundation

## 개요

카테고리는 앱의 기본 동작을 설정하고, 모드는 특화된 동작을 오디오 세션 카테고리에 적용합니다.

{% hint style="warning" %}
Important

오디오 세션 카테고리에 해당 카테고리가 지원하지 않는 모드를 지정하면 오디오 세션은 자동으로 default 모드를 사용하게 됩니다. (예: multiRoute 카테고리에 gameChat 모드 적용)
{% endhint %}

## 주제

### AudioSessioin Modes

* *static* *let* default: AVAudioSession.Mode\
  기본 오디오 세션 모드
* *static* *let* gameChat: AVAudioSession.Mode\
  이 모드는 Game Kit의 Voice chat 서비스를 사용하는 애플리케이션에서 Game Kit이 대신해서 설정하는 모드입니다.
* *static* *let* measurement: AVAudioSession.Mode\
  앱이 오디오의 입출력을 측정할 때 사용하세요.
* *static* *let* moviePlayback: AVAudioSession.Mode\
  앱이 영상 컨텐츠를 재생하는 경우에 사용하세요.
* *static* *let* spokenAudio: AVAudioSession.Mode\
  본인의 앱에서 연속적인 음성 오디오를 재생하고 있고, 다른 앱에서 짧은 길이의 음성 오디오가 재생될때 오디오를 일시 정지시키고 싶은 경우에 사용하는 모드.
* *static* *let* videoChat: AVAudioSession.Mode\
  온라인 비디오 회의에 참여할 때 사용하는 모드.
* *static* *let* videoRecording: AVAudioSession.Mode\
  앱이 비디오를 녹음할 때 사용하는 모드.
* *static* *let* voiceChat: AVAudioSession.Mode\
  VoIP와 같은 양방향 음성 커뮤니케이션을 수행할 때 사용하는 모드.
* *static* *let* voicePrompt: AVAudioSession.Mode\
  TTS 오디오를 재생하는 앱에서 사용하는 모드.

### Initializers

* init(rawValue: String)

## 관련 문서

### 준수하는 프로토콜

* Equatable
* Hashable
* RawRepresentable

## 같이 보기

### 오디오 세션 설정 <a href="#configuring-the-audio-session" id="configuring-the-audio-session"></a>

* *var* category: AVAudioSession.Category\
  현재 오디오 세션 카테고리
* *func* setCategory(AVAudioSession.Category)\
  현재 오디오 세션 카테고리를 새로 설정합니다.
* *var* availableCategories: \[AVAudioSession.Category]\
  현재 기기에서 사용가능한 오디오 세션 카테고리
* *struct* [AVAudioSession.Category](/sagwa/media/avfoundation/system-audio-interaction/avaudiosession/avaudiosession.category.md)\
  오디오 세션 카테고리 식별자
* *var* categoryOptions: AVAudioSession.CategoryOptions\
  현재 오디오 세션 카테고리와 관련된 옵션 마스크
* *func* setCategory(AVAudioSession.Category, options: AVAudioSession.CategoryOptions)\
  오디오 세션 카테고리를 지정된 옵션과 같이 설정합니다.
* struct AVAudioSession.CategoryOptions\
  오디오 동작 옵션을 가리키는 상수
* *var* mode: AVAudioSession.Mode\
  현재 오디오 세션 모드
* *func* setMode(AVAudioSession.Mode)

  현재 오디오 세션 모드를 설정합니다.
* *func* setCategory(AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions)\
  오디오 세션을 지정된 카테고리, 모드, 옵션으로 설정합니다.
* *var* availableModes: \[AVAudioSession.Mode]\
  현재 기기에서 사용가능한 오디오 세션 모드
* *var* routeSharingPolicy: AVAudioSession.RouteSharingPolicy\
  현재 라우트 공유 정책
* *func* setCategory(AVAudioSession.Category, mode: AVAudioSession.Mode, policy: AVAudioSession.RouteSharingPolicy, options: AVAudioSession.CategoryOptions)\
  오디오 세션을 지정된 카테고리, 모드, 라우트 공유 정책, 옵션으로 설정합니다.
* *enum* AVAudioSession.RouteSharingPolicy\
  오디오 세션에 사용 가능한 라우트 공유 정책을 가리킵니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://melod-it.gitbook.io/sagwa/media/avfoundation/system-audio-interaction/avaudiosession/avaudiosession.mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
