Answers.Body: <p>Not speaking for OceanInstruments, but having the opportunity to scan the source code of Soundtrap Software, I know that the Host code is programmed in C#.</p>
  <p>The SUD files are, in addition to a header, a sequence of data units (called chunks) that contain compressed acoustic, non-acoustic or other meta data. While definitely possible to re-design a command-line application, especially if one understands the filing philosophy, this may need some time and patience for testing.</p>
  <p>Obviously, using the PAMGuard java code as a starting point is possible but requires robust knowledge in java.</p>
  <p>Edit: While I have not tried them, see @Chloe for some links concerning     java examples.</p>
  <p>Edit: For python users, there is pyporcc that albeit made for porpoise clicks, includes an interface to soundtrap data.
  quoting from <a href="https://pypi.org/project/pyporcc/" rel="nofollow noreferrer">this link</a></p>
  <blockquote>
  <p>PyPorCC is a package that allows the detection and classification of
  Harbor Porpoises' clicks. The detection of clicks in continuous files
  is a python adaptation of the PAMGuard click detector algorithm.</p>
  </blockquote>
  <p>and</p>
  <blockquote>
  <p>The Click detector can be used in continuous wav files (with higher
  than 300 kHz sampling rate) or in the SoundTrap HF output files (*.bcl + *.dwv).
  For SoundTrapHF files, you can create a ClickDetectorSoundTrapHF object with the necessary parameters</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-08T13:43:23.590Z
Answers.Text: Oke, this partly answers my question. I think that that it is safe to assume that there is thus no command line tool for Soundtrap Host at the moment. Yes I read somewhere about x3 file compression and I tried a Rust solution for x3 compression. Unfortunately it was not that straight forward and it did not work. For now we will use the GUI and if we have time we can invest in the Java solution.
Answers.UserDisplayName: 3dSpatialUser
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-23T08:30:29.913Z
Answers.Text: Thank you for your edits, I will also look into the python solution.
Answers.UserDisplayName: 3dSpatialUser
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-07T16:46:00.963Z
Answers.LastActivityDate: 2022-12-23T08:54:28.333Z
Answers.LastEditDate: 2022-12-23T08:54:28.333Z
Answers.UserDisplayName: WMXZ
Answers.Body: <p>All of the SUD decompression code is on GitHub, here: <a href="https://github.com/macster110/x3/tree/main/X3/src/org/pamguard/x3/sud" rel="nofollow noreferrer">https://github.com/macster110/x3/tree/main/X3/src/org/pamguard/x3/sud</a></p>
  <p>Even if just a little Java programming was known, a command line tool could be used with the above.</p>
  <p>Specifically, here is an example Java 'script' to decompress a file:
  <a href="https://github.com/macster110/x3/blob/main/X3/src/org/pamguard/x3/sud/SudarFileTest.java" rel="nofollow noreferrer">https://github.com/macster110/x3/blob/main/X3/src/org/pamguard/x3/sud/SudarFileTest.java</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-09T12:14:36.637Z
Answers.LastActivityDate: 2022-12-09T12:14:36.637Z
Answers.UserDisplayName: Chloe
Body: <p>At the moment we are processing large amounts of SUD files. Now we are using SoundTrap Host to extract the SUD files. I would like to be able to extract the SUD files using python (or if that is not possible Rust or C++ which we can access from python) to streamline our data processing methods.</p>
  <p>I did not found the source code for SoundTrap Host. But in the last version of PAMGuard I saw that it is possible to extract the SUD files using Java [1]. If I am not mistaken this code focuses on BCL and DWV data. I would like to extract all information, like SoundTrap Host.</p>
  <p>If it is possible (since we just want to extract the files and we can process it later) a command-line interface of SoundTrap Host is also fine.</p>
  <p>Does anyone earlier encounter these kind of &quot;problems&quot; or &quot;requests&quot; and what was your solution?</p>
  <p>Kind regards,</p>
  <p>[1] <a href="https://github.com/PAMGuard/PAMGuard/tree/main/src/soundtrap/sud" rel="noreferrer">https://github.com/PAMGuard/PAMGuard/tree/main/src/soundtrap/sud</a></p>
  
Tags: <pamguard><soundtrap>
Title: SoundTrap SUD extracting
ThreadText: # SoundTrap SUD extracting
  
  (Asked by: username_0 on 2022-12-07)
  
  At the moment we are processing large amounts of SUD files. Now we are using SoundTrap Host to extract the SUD files. I would like to be able to extract the SUD files using python (or if that is not possible Rust or C++ which we can access from python) to streamline our data processing methods.
  
  I did not found the source code for SoundTrap Host. But in the last version of PAMGuard I saw that it is possible to extract the SUD files using Java [1]. If I am not mistaken this code focuses on BCL and DWV data. I would like to extract all information, like SoundTrap Host.
  
  If it is possible (since we just want to extract the files and we can process it later) a command-line interface of SoundTrap Host is also fine.
  
  Does anyone earlier encounter these kind of "problems" or "requests" and what was your solution?
  
  Kind regards,
  
  [1] <https://github.com/PAMGuard/PAMGuard/tree/main/src/soundtrap/sud>
  
  **Tags:** pamguard, soundtrap
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2022-12-09. Score: 4 | Accepted answer
  
  All of the SUD decompression code is on GitHub, here: <https://github.com/macster110/x3/tree/main/X3/src/org/pamguard/x3/sud>
  
  Even if just a little Java programming was known, a command line tool could be used with the above.
  
  Specifically, here is an example Java 'script' to decompress a file:
  <https://github.com/macster110/x3/blob/main/X3/src/org/pamguard/x3/sud/SudarFileTest.java>
  
  
  ---
  
  ### Answer by username_1 on 2022-12-07. Score: 0
  
  Not speaking for OceanInstruments, but having the opportunity to scan the source code of Soundtrap Software, I know that the Host code is programmed in C#.
  
  The SUD files are, in addition to a header, a sequence of data units (called chunks) that contain compressed acoustic, non-acoustic or other meta data. While definitely possible to re-design a command-line application, especially if one understands the filing philosophy, this may need some time and patience for testing.
  
  Obviously, using the PAMGuard java code as a starting point is possible but requires robust knowledge in java.
  
  Edit: While I have not tried them, see @username_2 for some links concerning java examples.
  
  Edit: For python users, there is pyporcc that albeit made for porpoise clicks, includes an interface to soundtrap data.
  quoting from [this link](https://pypi.org/project/pyporcc/)
  
  > PyPorCC is a package that allows the detection and classification of
  > Harbor Porpoises' clicks. The detection of clicks in continuous files
  > is a python adaptation of the PAMGuard click detector algorithm.
  
  and
  
  > The Click detector can be used in continuous wav files (with higher
  > than 300 kHz sampling rate) or in the SoundTrap HF output files (\*.bcl + \*.dwv).
  > For SoundTrapHF files, you can create a ClickDetectorSoundTrapHF object with the necessary parameters
  
  > **Comments:**
  > **username_0**: Oke, this partly answers my question. I think that that it is safe to assume that there is thus no command line tool for Soundtrap Host at the moment. Yes I read somewhere about x3 file compression and I tried a Rust solution for x3 compression. Unfortunately it was not that straight forward and it did not work. For now we will use the GUI and if we have time we can invest in the Java solution.  
  > **username_0**: Thank you for your edits, I will also look into the python solution.  
  
  ---
  
  