1

I am currently working on audio processing and I have many (approx 800) samples of 40s each. I am segmenting each file into roughly 8-12s clips based on ground truth data. This ends up creating 3200 files each time I run my code. Then I need to debug my code (if the audio isn't getting segmented satisfactorily). Nautilus hangs pretty often in this case. I have to delete permanently otherwise recycle bin crashes.
Can someone give me some useful tips and tricks to overcome/reduce this problem?
Edit : I normally do the following operations - sort by file size and play the largest file, delete all audio files if I find something wrong and see the file names in general if they are named as per requirement correctly.

  • 3
    I think command line tools will work much better than a file browser (but there are lighter file browsers than nautilus, for example pcmanfm and thunar). Command line tools: ls, find, cp, mv, rm. Please tell us which operations you need, and you can get detailed help. – sudodus Nov 27 '18 at 16:27
  • 1
    Please check the edit – Red Floyd Nov 27 '18 at 17:11
1

Suggested tools

  • There are manuals in the operating system, for example

    man ls
    man find
    man sort
    man rm
    man less
    
  • Maybe you find it better to use tutorials, that you can find via the internet, for example via the search string linux less tutorial.

  • It is a good idea to have a clean dedicated directory or directory tree, with only the audio file clips, so that you need not worry about tampering with any other files, that you want to keep. It will make the commands simpler and easier to run.

  • It is possible to have other files there, but then you must specify the file type for the files that you want to manage, for example *.mp3.

  • In the following examples, I assume that you have a clean dedicated directory or directory tree, with only the audio file clips, and that all files, that you want to keep are outside that directory.

  • In a terminal window you can re-use commands via the 'up-arrow' key.

  • You can also create alias so that you can type very short commands and get the whole command, that will perform the action you want. More about that later if necessary.

You normally do the following operations

  • First you change directory to your dedicated directory

    cd /path-to-directory/
    

    for example

    cd $HOME/clips
    
  • sort by file size and play the largest file

    • ls if a flat structure (no subdirectories to search)

      ls -Sr
      
    • find and sort if there are subdirectories to search

      find -type f -printf "%s\t%p\n"|sort -n
      

    will sort with the largest file last.

    • If you want to play that file directly in a flat structure, you can try with

      mplayer "$(ls -S|head -n1)"
      

      (or use some other player).

  • delete all audio files if you find something wrong

    • rm

    In a flat directory

        rm *
    

    or if there are subdirectories with files to delete

        rm -r *
    

    If there are other file types, that you want to keep, remove only the audio files for example mp3,

        rm *.mp3
        rm -r *.mp3
    
  • and see the file names in general if they are named as per requirement correctly.

    • ls and less

      ls | less
      

      or if you want one file on each line

      ls -1 | less
      

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.