Skip to content

Commit b81669c

Browse files
committed
feat: add audio functionality with assets and components documentation
1 parent c339685 commit b81669c

File tree

8 files changed

+177
-0
lines changed

8 files changed

+177
-0
lines changed

docs/en/_meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
"collapse": true
6060
}
6161
},
62+
"audio": {
63+
"title": "Audio",
64+
"theme": {
65+
"collapse": true
66+
}
67+
},
6268
"input": {
6369
"title": "Input",
6470
"theme": {

docs/en/audio/assets.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
order: 1
3+
title: Audio Assets
4+
type: Audio
5+
label: Audio
6+
---
7+
8+
9+
Audio assets are the core components in Galacean used for storing and managing audio files. Through audio assets, developers can conveniently upload, manage, and utilize various audio files.
10+
11+
## Supported Audio Formats
12+
13+
Galacean Engine supports a variety of commonly used audio formats, including but not limited to:
14+
- MP3
15+
- WAV
16+
- OGG
17+
18+
## Uploading and Managing Audio Files
19+
20+
Developers can easily upload audio files using the asset selector. Uploaded audio files are automatically stored in the asset library for subsequent use.
21+
22+
**Video Demonstration:**
23+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/dXVsQboyhYwAAAAAAAAAAAAADoY9AQFr" autoplay loop muted />
24+
25+
## Audio Preview
26+
27+
In the asset library, developers can preview audio files to ensure they meet the game's requirements.
28+
29+
**Video Demonstration:**
30+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/sZwaQr6CuAMAAAAAAAAAAAAADoY9AQFr" autoplay loop muted />
31+

docs/en/audio/component.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
order: 2
3+
title: Audio Component
4+
type: Audio
5+
label: Audio
6+
---
7+
8+
The Audio Component is a core component in Galacean used to add audio playback functionality to entities. Through the audio component, developers can control the playback, pausing, stopping, and volume adjustment of audio files.
9+
10+
## Adding the Audio Component
11+
12+
Developers can follow these steps to add the audio component to an entity:
13+
14+
1. **Select the Target Entity**: Choose the [Entity](/docs/core/entity) where you want to add the audio component.
15+
2. **Access the Inspector Panel**: Navigate to the Inspector panel for the selected entity.
16+
3. **Add the Component**: At the bottom of the Inspector panel, click on "Add Component" and select "AudioSource".
17+
18+
**Video Demonstration:**
19+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/JJ5QSKZKhzgAAAAAAAAAAAAADoY9AQFr" autoplay loop muted />
20+
21+
## Adjusting Volume and Mute
22+
23+
The audio component provides features to adjust the volume and mute the audio. Developers can control these properties either through scripts or directly in the Inspector panel.
24+
25+
**Video Demonstration:**
26+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/lDyIRbwv5nAAAAAAAAAAAAAADoY9AQFr" autoplay loop muted />
27+
28+
## Controlling Playback Timing
29+
30+
The audio component allows developers to precisely control the timing of audio playback. By using scripts, developers can invoke methods to play, pause, and stop audio files as needed.

docs/en/audio/overview.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
order: 0
3+
title: Audio Overview
4+
type: Audio
5+
label: Audio
6+
---
7+
8+
Galacean Engine provides comprehensive audio functionality, which is an essential part of creating an immersive gaming experience. The audio system in Galacean supports the import of various standard audio formats, allowing developers to add audio components to [Entities](/docs/core/entity) and precisely play sounds in 3D space, including background music and sound effects, thereby providing a more complete and realistic experience for the game.
9+
10+
## Audio Assets
11+
12+
Audio assets are the core components in Galacean used for storing and managing audio files. Through audio assets, developers can conveniently upload, manage, and utilize various audio files.
13+
14+
## Audio Component
15+
16+
The audio component is the core component in Galacean used to add audio playback functionality to entities. Through the audio component, developers can control the playback, pausing, stopping, and volume adjustment of audio files.
17+
18+
In this section, you can learn about:
19+
20+
- [Audio Assets](/docs/audio/assets/): Information about audio files and their supported formats
21+
- [Audio Component](/docs/audio/component/): Details about the audio component and its properties

docs/zh/_meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
"collapse": true
6060
}
6161
},
62+
"audio": {
63+
"title": "音频",
64+
"theme": {
65+
"collapse": true
66+
}
67+
},
6268
"input": {
6369
"title": "交互",
6470
"theme": {

docs/zh/audio/assets.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
order: 1
3+
title: 音频资产
4+
type: 音频
5+
label: Audio
6+
---
7+
8+
音频资产是 Galacean 中用于存储和管理音频文件的核心组件。通过音频资产,开发者可以方便地上传、管理和使用各种音频文件。
9+
10+
## 支持的音频格式
11+
12+
Galacean引擎支持多种常见的音频格式,包括但不限于:
13+
- MP3
14+
- WAV
15+
- OGG
16+
17+
## 上传和管理音频文件
18+
19+
开发者可以通过资产选择器轻松上传音频文件,上传的音频文件会自动存储在资产库中,方便后续使用。
20+
21+
**视频演示**
22+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/dXVsQboyhYwAAAAAAAAAAAAADoY9AQFr" autoPlay loop muted />
23+
24+
25+
## 音频预览
26+
27+
在资产库中,开发者可以预览播放音频文件,确保音频文件符合游戏需求。
28+
29+
**视频演示**
30+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/sZwaQr6CuAMAAAAAAAAAAAAADoY9AQFr" autoPlay loop muted />

docs/zh/audio/component.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
order: 2
3+
title: 音频组件
4+
type: 音频
5+
label: Audio
6+
---
7+
8+
音频组件是 Galacean 中用于在实体中添加音频播放功能的核心组件。通过音频组件,开发者可以控制音频的播放、暂停、停止以及音量调节等功能。
9+
10+
11+
## 添加音频组件
12+
13+
开发者可以按照以下步骤在实体中添加音频组件:
14+
15+
1. **选择目标实体**:在项目面板中选择需要添加音频组件的[实体](/docs/core/entity)
16+
2. **打开Inspector面板**:选中目标实体后,Inspector面板将显示该实体的所有组件。
17+
3. **添加组件**:在Inspector面板的底部,点击“添加组件”按钮,并从列表中选择“音频”。
18+
19+
**视频演示**
20+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/JJ5QSKZKhzgAAAAAAAAAAAAADoY9AQFr" autoplay loop muted />
21+
22+
## 调节音量和静音
23+
24+
音频组件提供了调节音量和静音的功能。开发者可以通过脚本或 Inspector 面板来控制这些属性。
25+
26+
**视频演示**
27+
<video src="https://gw.alipayobjects.com/v/huamei_edbbqz/afts/video/lDyIRbwv5nAAAAAAAAAAAAAADoY9AQFr" autoplay loop muted />
28+
29+
## 控制播放时机
30+
31+
音频组件允许开发者精确控制音频的播放时机。开发者可以通过脚本调用播放、暂停和停止等方法来控制音频的播放。

docs/zh/audio/overview.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
order: 0
3+
title: 音频概述
4+
type: 音频
5+
label: Audio
6+
---
7+
8+
Galacean引擎提供了音频功能,音频是构建沉浸式体验的重要组成部分。Galacean 的音频功能支持用户导入多种标准格式的音频资产,为 [Entity](/docs/core/entity) 添加音频组件,并能够在3D空间中精准播放声音,包括背景音乐和音效,为游戏提供更加完整和真实的体验。
9+
10+
11+
## 音频资产
12+
13+
音频资产是 Galacean 中用于存储和管理音频文件的核心组件。通过音频资产,开发者可以方便地上传、管理和使用各种音频文件。
14+
15+
## 音频组件
16+
17+
音频组件是 Galacean 中用于在实体中添加音频播放功能的核心组件。通过音频组件,开发者可以控制音频的播放、暂停、停止以及音量调节等功能。
18+
19+
在本章节,您可以了解到:
20+
21+
- [音频资产](/docs/audio/assets/):有关于音频文件及其支持的格式等参考信息
22+
- [音频组件](/docs/audio/component/):有关于音频组件相关属性

0 commit comments

Comments
 (0)