-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added docs for existing state * Renamed audio manager to SoundEffectPlayer. ---------
- Loading branch information
1 parent
d53e051
commit 9e36dc8
Showing
7 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Audio | ||
Ktvn supports audio to allow rich visual novels to be created. Audio is roughly broken in to two categories - | ||
background music and sound effects. | ||
|
||
## Background Music | ||
In Ktvn background music is specified as part of the **Scene**. This is documented on the [Customising Scenes](customising-scenes.md) | ||
page. | ||
|
||
## Sound Effects | ||
Sounds effects can be played during any **Step**. All sound effects require an **AudioManager** to play. | ||
|
||
### Sound Effect Player | ||
The **SoundEffectPlayer** is a class that invokes sound effects in Ktvn. It depends on an **AudioAdapter**. The | ||
**DynamicGameConfiguration** provides an instance of **AudioAdapter** that is suitable for nearly all use cases. | ||
|
||
```kotlin | ||
val configuration = DynamicGameConfiguration() | ||
val audio = SoundEffectPlayer(configuration.gameAdapter.audioAdapter) | ||
``` | ||
|
||
The **SoundEffectPlayer** can then be used to play sound effects with the **sfx** function. Here a **next** step is | ||
used to play *sfxWoosh*. | ||
|
||
```kotlin | ||
next { audio sfx sfxWoosh } | ||
``` | ||
|
||
In this case *sfxWoosh** is a **ResourceSoundEffect**, but a **FileSoundEffect** could also be used. | ||
|
||
```kotlin | ||
val sfxWoosh = soundEffectFromResource("shuttleLaunch/audio/woosh.wav") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.