Class WavDetExport

java.lang.Object
export.wavExport.WavDetExport

public class WavDetExport extends Object
  • Constructor Details

    • WavDetExport

      public WavDetExport()
  • Method Details

    • getWavDataUnitExporters

      public ArrayList<WavDataUnitExport> getWavDataUnitExporters()
      Get a list of exporters that can export wav files from a data unit.
      Returns:
      the wav file exporters.
    • haveRawData

      public static boolean haveRawData(PamRawDataBlock rawDataBlock, long start, long end)
      Check whether raw data is available.
      Returns:
      true if raw data for the specified period is available.
    • writeOverlayMarkWav

      public int writeOverlayMarkWav(DetectionGroupSummary foundDataUnits, int selectedIndex, OverlayMark mark)
      Convert the mark/dataunits to a .wav file. makes a decision as to what to save 1) Data units with no raw data in which case we want to export a wav clip from raw data
      2) Data units which all have raw data in which case we want to export data unit clips as a zero padded wav file (this counts for a single data unit too) 3) Mixed data units in which case we want to export a wav clip from raw data.
      Parameters:
      foundDataUnits - - found data units.
      selectedIndex - - the currently selected data unit.
      mark - - overlay mark.
    • writeDetGroupWav

      public int writeDetGroupWav(DetectionGroupSummary foundDataUnits, File filename, boolean zeroPad)
      Save wav data from a data unit instead of from the raw file store.
      Parameters:
      foundDataUnits - - the list of found data units.
      zeroPad - - if true will zeroPad detections.
      currentFile - - path to current file to save to.
      Returns:
      the number of data units that were saved.
    • writeDataUnitWavs

      public int writeDataUnitWavs(List<PamDataUnit> foundDataUnits, File currentFile)
      Save data units which contain raw data to individual wav files within a folder.
      Parameters:
      foundDataUnits - - list of data units to save.
      currentFile - - the current folder. If this is a file name the parent directory will be used.
      Returns:
      the number of data units saved
    • writeDataUnitWav

      public int writeDataUnitWav(List<PamDataUnit> foundDataUnits, File currentFile, boolean zeroPad)
      Save data units which contain raw data to a wav file. Note that this assumed the data units all contain raw data, the raw data is at the same sample rate and number of channels and the data units are in order. This will APPEND to the wav file if it currently exists.
      Parameters:
      foundDataUnits - - data units containing raw data.
      currentFile - - path to current file to save to.
      zeroPad - - if true will zeroPad detections.
      Returns:
      the number of data units saved - this should be the same as the size of the data unit list.
    • setOnWavSaved

      public void setOnWavSaved(WavSaveCallback saveCallback)
      Set a callback for saving .wav data.
      Parameters:
      saveCallback - - the callback