diff --git a/src/Acquisition/AcquisitionControl.java b/src/Acquisition/AcquisitionControl.java index 3d198980..e1f1025c 100644 --- a/src/Acquisition/AcquisitionControl.java +++ b/src/Acquisition/AcquisitionControl.java @@ -54,6 +54,7 @@ import asiojni.NewAsioSoundSystem; import nidaqdev.NIDAQProcess; import Acquisition.filedate.FileDate; import Acquisition.filedate.StandardFileDate; +import Acquisition.filetypes.SoundFileTypes; import Acquisition.layoutFX.AquisitionGUIFX; import Acquisition.offlineFuncs.OfflineWavFileServer; import Acquisition.rona.RonaOfflineFileServer; @@ -138,6 +139,8 @@ public class AcquisitionControl extends PamControlledUnit implements PamSettings private SUDNotificationManager sudNotificationManager; + protected SoundFileTypes soundFileTypes; + /** * Main control unit for audio data acquisition. *
@@ -162,6 +165,8 @@ public class AcquisitionControl extends PamControlledUnit implements PamSettings
pamController = PamController.getInstance();
+ soundFileTypes = new SoundFileTypes(this);
+
registerDaqSystem(new SoundCardSystem(this));
if (PlatformInfo.calculateOS() == OSType.WINDOWS) {
registerDaqSystem(new ASIOSoundSystem(this));
diff --git a/src/Acquisition/FileInputSystem.java b/src/Acquisition/FileInputSystem.java
index 9ec48538..1e976623 100644
--- a/src/Acquisition/FileInputSystem.java
+++ b/src/Acquisition/FileInputSystem.java
@@ -16,6 +16,8 @@ import java.io.IOException;
import java.io.Serializable;
import java.text.DateFormat;
import java.util.Calendar;
+import java.util.List;
+
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.UnsupportedAudioFileException;
@@ -53,6 +55,7 @@ import wavFiles.ByteConverter;
import Acquisition.filedate.FileDate;
import Acquisition.filedate.FileDateDialogStrip;
import Acquisition.filedate.FileDateObserver;
+import Acquisition.filetypes.SoundFileType;
import Acquisition.pamAudio.PamAudioFileManager;
import Acquisition.pamAudio.PamAudioFileFilter;
import PamController.PamControlledUnitSettings;
@@ -144,6 +147,11 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe
protected ByteConverter byteConverter;
protected FileDateDialogStrip fileDateStrip;
+
+ /**
+ * Sound file types present in the current selections.
+ */
+ private List If the SoundTrap was running with the click detector, then you should add a SoundTrap Click Detector module" +
+ " and detected clicks will automatically be extracted to binary files while processing the wav data." +
+ " See the Click Detector help for further details";
+
+ public SUDFileType() {
+ super(".sud");
+ }
+
+ @Override
+ public void selected(FileInputSystem fileInputSystem) {
+ if (isShown) {
+ return;
+ }
+ WarnOnce.showWarning("SoundTrap SUD Files", sudInfoText, WarnOnce.OK_OPTION);
+ isShown = true;
+ }
+
+}
diff --git a/src/Acquisition/filetypes/SoundFileType.java b/src/Acquisition/filetypes/SoundFileType.java
new file mode 100644
index 00000000..3ed778d3
--- /dev/null
+++ b/src/Acquisition/filetypes/SoundFileType.java
@@ -0,0 +1,65 @@
+package Acquisition.filetypes;
+
+import java.io.File;
+import java.util.List;
+
+import Acquisition.FileInputSystem;
+import Acquisition.pamAudio.PamAudioFileFilter;
+import PamUtils.worker.filelist.WavFileType;
+
+/**
+ * Some functions for the File and Folder input systems to give a bit of
+ * extra functionality / help for different file types. Primarily introduced
+ * to give a couple of extras for sud files.
+ * @author dg50
+ *
+ */
+public abstract class SoundFileType {
+
+ private String fileType;
+
+ private PamAudioFileFilter fileFilter = new PamAudioFileFilter();
+
+ public SoundFileType(String fileType) {
+ this.fileType = fileType.toLowerCase();
+ }
+
+ /**
+ * Work out if any files of this type are included in the current selection.
+ * @param fileOrFolder this for a single file.
+ * @param includeSubfolders used with folders.
+ * @return true if any exist.
+ */
+ public boolean isFileType(File oneFile) {
+ if (oneFile == null) {
+ return false;
+ }
+ if (oneFile.isFile()) {
+ return oneFile.getName().toLowerCase().endsWith(fileType);
+ }
+
+ return false;
+ }
+
+ /**
+ * Work out if any files of this type are included in the current selection.
+ * @param fileOrFolder this for a single file.
+ * @param includeSubfolders used with folders.
+ * @return true if any exist.
+ */
+ public boolean hasFileType(List If you are using a SountTrap recording device with built in click detection from
+Ocean Instruments,
+you may need to use a modified version of the Click Detector.
+ The SoundTrap click detector allows you to detect and store clicks at high frequencies (say 384kHz), suitable for odontocete echolocation clicks, and
+at the same time, record audio data files at a lower frequency (e.g. 96 or 48kHz). This optimises disk space usage and makes long deployments
+of several months possible with moderate data storage. Having two sample rates present within a single PAMGuard configuration is possible, using
+Decimator modules, however such configurations become particularly
+complicated to configure when the sample rate of the recorded files is lower than the sample rate of the click detector. We therefore recommend that you use a modified version of the Click Detectorwhich manages it's own sample rate and
+channel information based on information extracted from the SoundTrap data. Note that the SoundTrap click detector should only be used for clicks automatically detected by the SoundTrap. If you want to detect clicks from the
+SoundTrap recordings, then use a normal Click Detector in the normal way.
+ From the File>Add modules>Detectors menu, or
+ from the pop-up menu on the data model display, select 'SoundTrap Click
+ Detector' near the bottom of the list. Enter a descriptive name for the new detector and press Ok.
+ SoundTrap data are stored in proprietary files called SUD files. There are two ways in which you can get data from SUD files into
+ the SoundTrap Click Detector. The 'standard' way of using SoundTrap data was to inflate all of the data from the compressed SUD files. For details of this process, see the
+ SoundTrap user manuals and the SoundTrap Host software. Normally, several inflated files are generated from each sud file: To convert the SUD files to the binary storage format used by PAMGuard, working in the
+ PAMGuard Viewer, create a Binary Store, a
+ SoundTrap Click Detector and also create a 'SoundTrap Detector Import' module. Then use the import module to import the BCL and DWV
+ data into PAMGuard. Once imported you can run Click Classifiers
+ and use other Click Detector offline functions to mark events, etc. If you want to run additional analysis on the WAV file data (for example to make noise measurements or to detect whistles),
+ create a different PAMGuard configuration to process those data.
+
+ Current versions of PAMGuard can read SUD files directly, without first unpacking them into WAV, XML, BCL and DWV files. This not
+ only reduces the amount of disk space you need by about x4, but also saves a lot of time. Better still, you can now set up PAMGuard in normal mode to simultaneously process the audio data in the sud file with one set of
+ detectors, and simultaneously extract the click detector data into appropriate files for a SoundTrap Click Detector. Start PAMGuard in Normal Mode and add a
+ Sound Acquisition module.
+ Add a SoundTrap Click Detector, a Binary Store store and a
+ Database
+ module (optional). In the Sound Acquisition dialog
+ select a single SUD file or a folder of SUD files. At this point, the SoundTrap
+ Click Detector will be automatically configured with the correct sample rate (which won't be the sample rate displayed in the Sound Acquisition
+ module). Configure any Click Classifiers you want to be run on the SoundTrap click data as it is imported. You can then add any other detectors and measurement processes you want to run on the SoundTrap audio data, this may include
+ instances of the normal Click Detector module if you want to detect clicks in the lower frequency audio data. Process the data in the normal way and clicks will automatically be generated within the SoundTrap click detector Further process you data using the PAMGuard Viewer in the normal way. As well as analysing data from sound cards in real time, PAMGUARD can be used to analyse archived data
-from audio filed in WAV or AIF format.
+SoundTrap recorders from
+Ocean Instruments
+ store data in proprietary files called SUD files. See SoundTrap documentation for information on how to
+ extract SUD files from SoundTrap recorders. Earlier versions of PAMGuard required you to 'inflate' the SUD files into standard wav audio files using
+ the SoundTrap Host software before they could be processed. The current version of PAMGuard no longer requires this since it can read data directly from the SUD files. Inflating SUD files to WAV files generally required between 3 and 5 times as much disk space and could also take
+ a fair amount of time, so not inflating will save both! If you are using the SoundTrap build in click detector (see SoundTrap manuals) then the SUD files will also contain
+ detected clicks. See the help page for the SoundTrap Click Detector
+ for information on how to get these clicks from the SUD files into PAMGuard.
+SoundTrap Click Detector
+
SoundTrap Click Detector
+
+
+Overview
+Creating an instance of the SoundTrap Click Detector
+
+ Importing SoundTrap Data
+ The Old Way
+
+
+ The (better) New Way
+
+
+
+
\ No newline at end of file
diff --git a/src/help/sound_processing/AcquisitionHelp/docs/AcquisitionFile.html b/src/help/sound_processing/AcquisitionHelp/docs/AcquisitionFile.html
index caabb5f8..bf07f25e 100644
--- a/src/help/sound_processing/AcquisitionHelp/docs/AcquisitionFile.html
+++ b/src/help/sound_processing/AcquisitionHelp/docs/AcquisitionFile.html
@@ -7,7 +7,9 @@
Audio Files
Setting up an Audio File
diff --git a/src/help/sound_processing/AcquisitionHelp/docs/sudfiles.html b/src/help/sound_processing/AcquisitionHelp/docs/sudfiles.html
new file mode 100644
index 00000000..770bdb1b
--- /dev/null
+++ b/src/help/sound_processing/AcquisitionHelp/docs/sudfiles.html
@@ -0,0 +1,27 @@
+
+
+
+SoundTrap data files
+SUD Files
+SoundTrap Click Detector
+
+
+
\ No newline at end of file
diff --git a/src/soundtrap/sud/SudFileDWVHandler.java b/src/soundtrap/sud/SudFileDWVHandler.java
index 6129c381..a9f780e2 100644
--- a/src/soundtrap/sud/SudFileDWVHandler.java
+++ b/src/soundtrap/sud/SudFileDWVHandler.java
@@ -216,6 +216,7 @@ public class SudFileDWVHandler implements SUDNotificationHandler {
// channelGroupDetector = clickDetector.getChannelGroupDetector(0);
ClickDetection click = new ClickDetection(1, elapsedSamples, nSamples, clickDetector, channelGroupDetector, 1);
+ click.setTimeMilliseconds(millis);
click.setWaveData(wavData);
// if (groupDetector != null) {