From c0f48964ca69c1776b54ae76acf711dd33198538 Mon Sep 17 00:00:00 2001 From: Deathsbreed Date: Wed, 8 Oct 2014 21:55:13 -0500 Subject: [PATCH] Added a few things. --- src/freqsample/FreqSample.java | 9 +++++++-- src/freqsample/Generator.java | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/freqsample/FreqSample.java b/src/freqsample/FreqSample.java index 503239d..3c17d58 100644 --- a/src/freqsample/FreqSample.java +++ b/src/freqsample/FreqSample.java @@ -4,9 +4,14 @@ import java.awt.event.*; import javax.swing.*; import javax.sound.sampled.*; +/** + * @author Nicolás A. Ortega + * @copyright Nicolás A. Ortega + * @license GNU GPLv3 + * @year 2014 + * + */ public class FreqSample { - public static final String version = "v0.2"; - private JFrame frame; private JPanel panel; private JTextField hzField, msField; diff --git a/src/freqsample/Generator.java b/src/freqsample/Generator.java index c170cc0..c0e671f 100644 --- a/src/freqsample/Generator.java +++ b/src/freqsample/Generator.java @@ -7,7 +7,7 @@ import javax.swing.*; /** * @author Nicolás A. Ortega * @copyright Nicolás A. Ortega - * @license GPLv3 + * @license GNU GPLv3 * @year 2014 * */ @@ -35,7 +35,8 @@ public class Generator { ByteBuffer cBuf = ByteBuffer.allocate(line.getBufferSize()); - int ctSamplesTotal = (int)(SAMPLE_RATE * msecs / 1000); + int ctSamplesTotal = (int)(SAMPLE_RATE * (msecs / 1000)); + if(ctSamplesTotal < 150) ctSamplesTotal = 150; while(ctSamplesTotal > 0) { double fCycleInc = fFreq/SAMPLE_RATE;