Added a few things.
This commit is contained in:
parent
2ae030df92
commit
c0f48964ca
@ -4,9 +4,14 @@ import java.awt.event.*;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.sound.sampled.*;
|
import javax.sound.sampled.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Nicolás A. Ortega
|
||||||
|
* @copyright Nicolás A. Ortega
|
||||||
|
* @license GNU GPLv3
|
||||||
|
* @year 2014
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class FreqSample {
|
public class FreqSample {
|
||||||
public static final String version = "v0.2";
|
|
||||||
|
|
||||||
private JFrame frame;
|
private JFrame frame;
|
||||||
private JPanel panel;
|
private JPanel panel;
|
||||||
private JTextField hzField, msField;
|
private JTextField hzField, msField;
|
||||||
|
@ -7,7 +7,7 @@ import javax.swing.*;
|
|||||||
/**
|
/**
|
||||||
* @author Nicolás A. Ortega
|
* @author Nicolás A. Ortega
|
||||||
* @copyright Nicolás A. Ortega
|
* @copyright Nicolás A. Ortega
|
||||||
* @license GPLv3
|
* @license GNU GPLv3
|
||||||
* @year 2014
|
* @year 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -35,7 +35,8 @@ public class Generator {
|
|||||||
|
|
||||||
ByteBuffer cBuf = ByteBuffer.allocate(line.getBufferSize());
|
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) {
|
while(ctSamplesTotal > 0) {
|
||||||
double fCycleInc = fFreq/SAMPLE_RATE;
|
double fCycleInc = fFreq/SAMPLE_RATE;
|
||||||
|
Loading…
Reference in New Issue
Block a user