Volume Control
Manage individual and group volume.
Introduction
Manage individual and group volume. This page provides a complete guide to volume control in Appley, covering everything from setup to advanced techniques.
Audio is a core area of Appley. Understanding volume control will help you build better games and use the platform more effectively. This documentation is designed for beginner level users.
Requirements
Before working with volume control, ensure you have the following:
- Audio files (MP3, WAV, OGG)
- An Appley project
- Basic understanding of game audio
- Optional: Freesound API key for sound search
Estimated Completion Time
Step-by-Step Guide
Follow these steps to work with volume control in your Appley project:
Prepare audio files
Obtain or create audio files in MP3, WAV, or OGG format for volume control.
Import audio
Upload the audio files through the Asset Browser in Creator Studio.
Configure audio source
Set the audio properties: loop, volume, pitch, 3D spatial, and channel.
Script playback
Use the audio API in Appley Scripting to play and control sounds.
Mix and test
Adjust volume levels and test the audio mix. Use the Audio Manager.
FluxScript Example
Below is an Appley Scripting (Flux Scripting) code example demonstrating volume control:
// Audio — Volume Control
on start {
audio.playLoop("ambient_wind")
audio.setVolume("ambient_wind", 0.3)
bgm = audio.play("bgm", { volume: 0.7, loop: true })
}
on collision(other) {
if other.type == "coin" {
audio.play("collect", { pitch: 1.0 + math.random(0.2) })
}
if other.type == "enemy" {
audio.play("hit", { volume: 0.9 })
audio.setPitch("hit", 0.8)
}
}
on event("gameOver") {
audio.fadeOut("bgm", 1.5)
}Node Script Example
The same logic can be implemented using Node Scripting. Here is the equivalent node graph:
[On Collision] ──► [Branch: type]
├─ "coin" ──► [Play: "collect", random pitch]
└─ "enemy" ──► [Play: "hit", volume 0.9]
[On Event "gameOver"] ──► [Fade Out: "bgm", 1.5s]Interchangeable Systems
Common Mistakes
Avoid these frequent mistakes when working with volume control:
Using uncompressed WAV files for long music
Use MP3 or OGG for background music to reduce file size.
Playing too many simultaneous audio sources
Limit to 8-10 concurrent sounds. Use audio channels for grouping.
Not setting 3D audio properties
Enable spatial audio for positional sounds like footsteps and gunfire.
Loading all audio at startup
Stream long audio files instead of loading them into memory.
Troubleshooting
If you encounter issues with volume control, try these solutions:
No sound plays
Audio is distorted
3D audio has no direction
Audio loops have a gap
Performance Tips
Optimize your use of volume control with these performance tips:
- Use audio channels to group sounds (music, sfx, voice) for independent volume control.
- Randomize pitch slightly (0.9-1.1) on repeated sound effects to avoid monotony.
- Use audio occlusion for realistic sound blocking behind walls.
- Pre-load frequently used short sounds; stream long music tracks.
Related Pages
Explore these related documentation pages:
Example Project
Download a complete example project demonstrating volume control:
