SOUNDS - Episode #25 - Platformer Tutorial Java

Опубликовано: 06 Май 2026
на канале: Kaarin Gaming
7,127
148

00:00 Intro
01:16 Recap
02:16 AudioPlayer and Audio Import
06:41 Clip Explained (kinda)
08:05 GetClip Method
16:30 UpdateVolume Method
22:29 Toggle Mute
25:44 Play Sounds
36:40 setGamestate Method
41:49 AudioOptions Work
48:14 Adding Effects
45:38 Final Test
56:34 Outro

Hello!
Today we add sounds in our game. Using Clip that comes along with java by default we can get a very basic, but functional sound system in our game.
Use the .Wav files in github or on my website. If you were to add your own, make sure to use wav files that can be controlled with volume and mute.
clip.getControls() will tell you what controls you have access to for each clip / sound. Store the return array in a control array and then syso each index to see what the control is. Clip documentation can tell you more.

https://docs.oracle.com/javase/7/docs...

I found a few .wav files not working as I wanted. The solution(debatable) was to keep the Bitrate of the .wav file to 1411 kbps or less, and 44100 hz in sample rate.

Best approach to adding sounds to your own game, would be to use an external library with faster response time and also more file formats.
This episode is to give you a taste of working with sound.
Good Luck!


** LINKS **
Support me at - https://www.buymeacoffee.com/kaaringa...
Website - https://www.kaaringaming.com/
gitHub - https://github.com/KaarinGaming
Discord -   / discord  
Twitter -   / kaaringaming  
Art Maker - https://pixelfrog-assets.itch.io/
*************

Want to make a platformer game? And in Java?
We build this one from scratch. No gameengine or shortcuts.
This is for beginners of game development, or those who just started.
Some of the things we will cover are:
GameWindow
Gameloop
Inputs
Animations
Line of Sight
Enemies
Collisions
Event handling
Rendering
and much more.

Don't forget to subscribe and like the video.
If there is anything that's unclear, post a comment or join us on discord and ask it there.
Hope you enjoy this episode and good luck!

#java #tutorial #development