Skip to content

Commit 6ab3a66

Browse files
committed
adjust naming: getAudioFormat() -> buildAudioFormat()
1 parent 31f594f commit 6ab3a66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound-recorder-n-spectrum-analyzer/src/main/java/by/andd3dfx/capturesound/AudioCaptureApp.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public AudioCaptureApp() {
5858
stopButton.setEnabled(true);
5959
playButton.setEnabled(false);
6060

61-
AudioFormat audioFormat = getAudioFormat();
61+
AudioFormat audioFormat = buildAudioFormat();
6262
DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, audioFormat);
6363
try {
6464
TargetDataLine targetDataLine = (TargetDataLine) AudioSystem.getLine(dataLineInfo);
@@ -84,7 +84,7 @@ public AudioCaptureApp() {
8484
playButton.addActionListener(e -> {
8585
byte audioData[] = captureThread[0].getByteArrayOutputStream().toByteArray();
8686
InputStream byteArrayInputStream = new ByteArrayInputStream(audioData);
87-
AudioFormat audioFormat = getAudioFormat();
87+
AudioFormat audioFormat = buildAudioFormat();
8888

8989

9090
double frequency = frequencyScanner.detectFrequency(audioData, (int) audioFormat.getSampleRate())
@@ -113,7 +113,7 @@ public Insets getInsets() {
113113
return new Insets(40, 20, 10, 20);
114114
}
115115

116-
private AudioFormat getAudioFormat() {
116+
private AudioFormat buildAudioFormat() {
117117
return new AudioFormat(44_100.0F, 16, 1, true, false);
118118
}
119119
}

0 commit comments

Comments
 (0)