Skip to content

Commit

Permalink
0.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpiz097 committed May 12, 2018
1 parent 7d76a60 commit 4f14bf0
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/dist/
/nbproject/private/
/nbproject/private/
/build/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ Java library that provides tools for audio recording and playback.
0.9.2 - Close and setGain methods in the Speaker class.
- Close and getInputStream method added to Microphone class.
0.9.3 - Set open methods

0.9.4 - Add getControl method to Speaker and Microphone
2 changes: 1 addition & 1 deletion build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue, 03 Apr 2018 21:46:29 -0300
#Sat, 12 May 2018 12:04:54 -0300


/home/martin/Dropbox/Java/Proyectos/NetBeansProjects/AuCom=
Binary file modified build/classes/org/aucom/sound/AudioInterface.class
Binary file not shown.
Binary file modified build/classes/org/aucom/sound/Microphone.class
Binary file not shown.
Binary file modified build/classes/org/aucom/sound/Speaker.class
Binary file not shown.
Binary file modified build/classes/org/aucom/test/Main.class
Binary file not shown.
3 changes: 2 additions & 1 deletion nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
<file>file:/home/martin/Dropbox/Java/Proyectos/NetBeansProjects/AuCom/src/org/aucom/sound/Microphone.java</file>
<file>file:/home/martin/Dropbox/Java/Proyectos/NetBeansProjects/AuCom/src/org/aucom/sound/AudioInfo.java</file>
</group>
<group name="VIDEOS"/>
<group name="PLAYER">
<file>file:/home/martin/Dropbox/Java/Proyectos/NetBeansProjects/AuCom/src/org/aucom/test/Main.java</file>
<file>file:/home/martin/Dropbox/Java/Proyectos/NetBeansProjects/AuCom/src/org/aucom/sound/Speaker.java</file>
<file>file:/home/martin/Dropbox/Java/Proyectos/NetBeansProjects/AuCom/src/org/aucom/sound/AudioQuality.java</file>
<file>file:/home/martin/Dropbox/Java/Proyectos/NetBeansProjects/AuCom/src/org/aucom/io/ByteBuffer.java</file>
</group>
<group name="VIDEOS"/>
</open-files>
</project-private>
2 changes: 2 additions & 0 deletions src/org/aucom/sound/AudioInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package org.aucom.sound;

import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.FloatControl;
import javax.sound.sampled.LineUnavailableException;

/**
Expand All @@ -21,6 +22,7 @@ public AudioInterface(AudioFormat quality) {}
public abstract void configure(AudioFormat format) throws LineUnavailableException;
public abstract boolean isOpen();
public abstract AudioFormat getFormat();
public abstract FloatControl getControl(FloatControl.Type type);
public abstract void open() throws LineUnavailableException;
public abstract void stop();
public abstract void close();
Expand Down
5 changes: 5 additions & 0 deletions src/org/aucom/sound/Microphone.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.FloatControl;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.TargetDataLine;
import static org.aucom.sound.AudioInfo.BUFF_SIZE;
Expand Down Expand Up @@ -72,6 +73,10 @@ public AudioFormat getFormat(){
return driver.getFormat();
}

public FloatControl getControl(FloatControl.Type type) {
return (FloatControl) driver.getControl(type);
}

@Override
public void open() throws LineUnavailableException {
//AudioFormat format = driver == null ? null : driver.getFormat();
Expand Down
7 changes: 5 additions & 2 deletions src/org/aucom/sound/Speaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javax.sound.sampled.DataLine;
import javax.sound.sampled.FloatControl;
import javax.sound.sampled.FloatControl.Type;
import javax.sound.sampled.Line;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;
import static org.aucom.sound.AudioInfo.DEFAULT_FORMAT;
Expand Down Expand Up @@ -69,8 +68,12 @@ public AudioFormat getFormat(){
return driver.getFormat();
}

public FloatControl getControl(FloatControl.Type type) {
return (FloatControl) driver.getControl(type);
}

@Override
public void open() throws LineUnavailableException{
public void open() throws LineUnavailableException {
AudioFormat format = driver.getFormat();
driver.open(format == null ? DEFAULT_FORMAT : format);
driver.start();
Expand Down
12 changes: 10 additions & 2 deletions src/org/aucom/test/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
* and open the template in the editor.
*/
package org.aucom.test;
import java.io.File;
import java.io.IOException;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javax.sound.sampled.LineUnavailableException;
import org.aucom.sound.AudioQuality;
import org.aucom.sound.Microphone;
Expand All @@ -16,7 +19,12 @@
*/
public class Main {
public static void main(String[] args) throws LineUnavailableException, IOException {
Microphone micro = new Microphone(AudioQuality.HIGH);
File sound = new File("/home/martin/AudioTesting/music/John Petrucci/" +
"When_The_Keyboard_Breaks_Live_In_Chicago/Universal_Mind.m4a");
Media song = new Media(sound.toURI().toString());
MediaPlayer player = new MediaPlayer(song);
player.play();
/*Microphone micro = new Microphone(AudioQuality.HIGH);
Speaker speaker = new Speaker(AudioQuality.HIGH);
micro.open();speaker.open();
Expand All @@ -36,7 +44,7 @@ public static void main(String[] args) throws LineUnavailableException, IOExcept
// list.add(micro.readAudio(32));
//
// for (byte[] buffer : list)
// System.out.println(Arrays.toString(buffer));
// System.out.println(Arrays.toString(buffer));*/
}

}

0 comments on commit 4f14bf0

Please sign in to comment.