Skip to content

Commit

Permalink
preparing for decode from soundcard
Browse files Browse the repository at this point in the history
  • Loading branch information
damico committed Oct 21, 2023
1 parent ba65c1d commit 28141d9
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 24 deletions.
23 changes: 0 additions & 23 deletions java-land/.project

This file was deleted.

41 changes: 41 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,45 @@


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>rtl433toaprs</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
org.jdamico.javax25.App
</mainClass>
</manifest>

<manifestEntries>
<Implementation-Vendor>Jose Damico (PU2LVM)</Implementation-Vendor>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>

</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>



</executions>
</plugin>


</plugins>
</build>
</project>
61 changes: 60 additions & 1 deletion src/main/java/org/jdamico/javax25/App.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
package org.jdamico.javax25;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Properties;

import org.jdamico.javax25.ax25.Afsk1200Modulator;
import org.jdamico.javax25.ax25.Afsk1200MultiDemodulator;
import org.jdamico.javax25.ax25.Packet;
import org.jdamico.javax25.ax25.PacketDemodulator;
import org.jdamico.javax25.radiocontrol.SerialTransmitController;
import org.jdamico.javax25.radiocontrol.TransmitController;
import org.jdamico.javax25.soundcard.Soundcard;

/**
* Hello world!
*
Expand All @@ -8,6 +21,52 @@ public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
Soundcard.enumerate();
SerialTransmitController.enumerate();

Properties p = System.getProperties();

int rate = 48000;
int filter_length = 32;

PacketHandlerImpl t = new PacketHandlerImpl();
Afsk1200Modulator mod = null;
PacketDemodulator multi = null;
try {
multi = new Afsk1200MultiDemodulator(rate,t);
mod = new Afsk1200Modulator(rate);
} catch (Exception e) {
System.out.println("Exception trying to create an Afsk1200 object: "+e.getMessage());
}


/*** preparing to generate or capture audio packets ***/

String input = null;
String output = "PulseAudio Mixer";

int buffer_size = -1;
try {
// our default is 100ms
buffer_size = Integer.parseInt(p.getProperty("latency", "100").trim());
} catch (Exception e){
System.err.println("Exception parsing buffersize "+e.toString());
}

Soundcard sc = new Soundcard(rate,input,output,buffer_size,multi,mod);

if (p.containsKey("audio-level")) {
sc.displayAudioLevel();
}


/*** listen for incoming packets ***/

if (input != null) {
System.out.printf("Listening for packets\n");
//sc.openSoundInput(input);
sc.receive();
}

}
}

0 comments on commit 28141d9

Please sign in to comment.