Answers.Body: <p>If you want to read SUD files and write split-up WAV files, then this could be achieved in PAMGuard.</p>
  <p>The idea here would be to use PAMGuard's &quot;Sound acquisition&quot; module to read the SUD files, and PAMGuard's &quot;Sound recorder&quot; module to write wav files. The sound recorder allows you to specify the shorter of the maximum duration and file size.</p>
  <p>Detailed steps:</p>
  <ul>
  <li>Add a Sound Acquisition module.
  <ul>
  <li>Set Data Source Type to 'Audio file folder or multiple files'</li>
  <li>Browse to select the single .sud file or folder of .sud files you want to process<br />
  *<em>Note, if there are .wav files in the same folder as the .sud files you want to read, the .sud files will not appear! If .wav's were created with SoundTrap Host, move the .sud files to their own folder and try to look for them again</em></li>
  </ul>
  </li>
  <li>Add a Sound Recording module
  <ul>
  <li>Under Settings &gt; Files and Folders modify the output folder (if you want) and set the file length or size that you want</li>
  <li>On the Control tab change PAMGuard Startup Options to 'Start Recording' and hit 'Ok'</li>
  </ul>
  </li>
  <li>Press the red record button at the top!</li>
  <li>I don't know if this matters or not, but after it was done, I changed the PAMGuard Startup Options to 'Remain idle' before saving my configuration and exiting. I didn't want to accidentally open this preferences file in the future and start to overwrite/rewrite these files (but this may not matter...just unclear on how that option works)</li>
  </ul>
  <p><a href="https://i.sstatic.net/DdKr3qr4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DdKr3qr4.png" alt="Sound recorder and data flow for simple PAMGuard sud-&gt;split wav" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-21T18:42:48.933Z
Answers.Text: I guess, that is a better method,
Answers.UserDisplayName: WMXZ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-22T04:49:29.617Z
Answers.Text: This looks promising - I'll give this a try!
Answers.UserDisplayName: selene
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-19T16:08:25.350Z
Answers.Text: This worked and was relatively straightforward! I had never used the sound recorder module in Pamguard so had to work out a few additional details and I added those to the answer in case they will help anyone else. There were two small 'issues' - the newly written files are in UTC (https://github.com/PAMGuard/PAMGuard/issues/113) while my original files are in local time and it's not possible to output the file name exactly as default .sud/SoundTrapHost unpacked .wav file name. Not deal breakers just an FYI.
Answers.UserDisplayName: selene
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-21T04:32:32.167Z
Answers.LastActivityDate: 2024-11-19T16:28:01.873Z
Answers.LastEditDate: 2024-11-19T16:28:01.873Z
Answers.UserDisplayName: Brian Miller
Answers.Body: <p>Maybe <a href="https://github.com/Sound-Net/sudunarchiver" rel="nofollow noreferrer">https://github.com/Sound-Net/sudunarchiver</a> is the way to go. I have not looked into the code but Jamie may chime in and tell you more. As I have not done Java programming for about 30 Years, I may not of great help adapting this SW.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-22T04:50:23.980Z
Answers.Text: Thanks WMXZ this seems potentially useful but also maybe beyond my skill set. I'm going to give the other answer a try and will report back.
Answers.UserDisplayName: selene
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-19T18:49:10.570Z
Answers.LastActivityDate: 2024-10-19T18:49:10.570Z
Answers.UserDisplayName: WMXZ
Body: <p>I accidentally didn't program my ST300 properly to record just 5 min files, and ended up with 1 hr files at 288 kHz so they are very large. I'd like to split them into smaller files so they are a bit more manageable for analysis. Is there any way within the SoundTrap software or in Pamguard to split the raw .sud files?</p>
  <p>I can read in and rewrite the .wav files in MATLAB but just thought I'd check if there was a more 'preferred' way. There are only 3 files so the method doesn't need to be particularly fast.</p>
  
Tags: <soundtrap><data-processing><files>
Title: Native way to split SoundTrap .sud or .wav files?
ThreadText: # Native way to split SoundTrap .sud or .wav files?
  
  (Asked by: username_0 on 2024-10-18)
  
  I accidentally didn't program my ST300 properly to record just 5 min files, and ended up with 1 hr files at 288 kHz so they are very large. I'd like to split them into smaller files so they are a bit more manageable for analysis. Is there any way within the SoundTrap software or in Pamguard to split the raw .sud files?
  
  I can read in and rewrite the .wav files in MATLAB but just thought I'd check if there was a more 'preferred' way. There are only 3 files so the method doesn't need to be particularly fast.
  
  **Tags:** soundtrap, data-processing, files
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-10-21. Score: 2 | Accepted answer
  
  If you want to read SUD files and write split-up WAV files, then this could be achieved in PAMGuard.
  
  The idea here would be to use PAMGuard's "Sound acquisition" module to read the SUD files, and PAMGuard's "Sound recorder" module to write wav files. The sound recorder allows you to specify the shorter of the maximum duration and file size.
  
  Detailed steps:
  
  * Add a Sound Acquisition module.
    + Set Data Source Type to 'Audio file folder or multiple files'
    + Browse to select the single .sud file or folder of .sud files you want to process  
      \**Note, if there are .wav files in the same folder as the .sud files you want to read, the .sud files will not appear! If .wav's were created with SoundTrap Host, move the .sud files to their own folder and try to look for them again*
  * Add a Sound Recording module
    + Under Settings > Files and Folders modify the output folder (if you want) and set the file length or size that you want
    + On the Control tab change PAMGuard Startup Options to 'Start Recording' and hit 'Ok'
  * Press the red record button at the top!
  * I don't know if this matters or not, but after it was done, I changed the PAMGuard Startup Options to 'Remain idle' before saving my configuration and exiting. I didn't want to accidentally open this preferences file in the future and start to overwrite/rewrite these files (but this may not matter...just unclear on how that option works)
  
  [![Sound recorder and data flow for simple PAMGuard sud->split wav](https://i.sstatic.net/DdKr3qr4.png)](https://i.sstatic.net/DdKr3qr4.png)
  
  > **Comments:**
  > **username_2**: I guess, that is a better method,  
  > **username_0**: This looks promising - I'll give this a try!  
  > **username_0**: This worked and was relatively straightforward! I had never used the sound recorder module in Pamguard so had to work out a few additional details and I added those to the answer in case they will help anyone else. There were two small 'issues' - the newly written files are in UTC (https://github.com/PAMGuard/PAMGuard/issues/113) while my original files are in local time and it's not possible to output the file name exactly as default .sud/SoundTrapHost unpacked .wav file name. Not deal breakers just an FYI.  
  
  ---
  
  ### Answer by username_2 on 2024-10-19. Score: 1
  
  Maybe <https://github.com/Sound-Net/sudunarchiver> is the way to go. I have not looked into the code but Jamie may chime in and tell you more. As I have not done Java programming for about 30 Years, I may not of great help adapting this SW.
  
  > **Comments:**
  > **username_0**: Thanks username_2 this seems potentially useful but also maybe beyond my skill set. I'm going to give the other answer a try and will report back.  
  
  ---
  
  