javax.sound.sampled cannot change volume of clip
The method above should play a .wav file at the specified volume (file is a byte[] loaded from the .wav).
However, Java tells me that it's an unsupported control type. I've tried everything and none of it works. Am I just missing something obvious? This is what the oracle site told me to do. I have a windows 11 surface pro 7, and Minecraft can change audio volume, so it's not my device. Help?
20 Replies
⌛
This post has been reserved for your question.
Hey @The Typhothanian! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
anyone?
ugh
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Stack Overflow
Set volume of Java Clip
Is there any way to set the respective volume of a Clip in Java?
I have this method:
public static void play(Clip clip) {
if (Settings.getSettings().isVolumeOn()) {
FloatControl volum...
wth
FloatControl.Type.MASTER_GAIN
lemme check
Same error
All control types are unsupported
Does it work with other types of audio?
i.e. non-WAV
what's the exact exception?
sorry
or small
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Unsupported control type: Volume
at java.desktop/com.sun.media.sound.AbstractLine.getControl(AbstractLine.java:149)
at net.typho.utils.resources.AudioFile.play(AudioFile.java:42)
at net.typho.utils.uwt.UButton$1.mousePressed(UButton.java:42)
Getting a bunch of "stream of unsupported format"s. Which formats are supported, do you know?
and you also get unsupported control type
MASTER_GAIN
?
?Yeah, all controls are unsupported.
Also, I was doing .wav, but with .aiff and .mp3 got UnsupportedAudioFileExceptions
yeah Java doesn't support mp3 by default
I tried a bunch of stuff on the web but all of it's from 2011 so no luck
Stack Overflow
AbstractLine Unsupported control type: Master Gain Java
I am having an error when using Clip.getControl() as per:-
import java.io.File;
import java.io.IOException;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
imp...
lol
first open
then change the controls
i am so absolutely stupid omg
Does it work?
had to move after the start but yeah
Post Closed
This post has been closed by <@801145088830210129>.