-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from umjammer/1.0.12
1.0.12
- Loading branch information
Showing
206 changed files
with
2,720 additions
and
3,127 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
tmp/ | ||
etc/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2022 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package vavi.sound; | ||
|
||
import javax.sound.sampled.DataLine; | ||
import javax.sound.sampled.FloatControl; | ||
|
||
|
||
/** | ||
* SoundUtil. | ||
* | ||
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer) | ||
* @version 0.00 2022/02/13 umjammer initial version <br> | ||
*/ | ||
public final class SoundUtil { | ||
|
||
private SoundUtil() {} | ||
|
||
/** | ||
* @param gain number between 0 and 1 (loudest) | ||
* @before {@link DataLine#open()} | ||
*/ | ||
public static void volume(DataLine line, double gain) { | ||
FloatControl gainControl = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN); | ||
float dB = (float) (Math.log10(gain) * 20.0); | ||
gainControl.setValue(dB); | ||
} | ||
} | ||
|
||
/* */ |
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
Oops, something went wrong.