VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. Hi I need some help with this question if anyone can help me with this

    Does anyone know of any software that will split and convert like a 4 minute WAV file to a 5 second WAV file parts. I have got some WAV files that are like 4 minutes long of sounds and what I want to do if it can be done is can I split and convert like a 4 minute WAV file into parts like 5 second WAV audio files parts. I can do this manual with AudaCity but doing this with like over 50 WAV 4 minute files would take ages to do I know that when you convert video files you can leave a software to convert a load of video files but this is audio files. and I want to split like a 4 minute WAV file into like 5 second wav files is there any software that will do this instead of doing this manual file by file. like is there a converter we’re you put in like how long you want your audio file to be and it splits it into parts I don’t know of any software that will do this only doing it manual with audacity one file at a time which does take ages to do any help will do.
    Quote Quote  
  2. I'm not good with this type batch file. So I'm not going to attempt it.
    I believe FFMPEG with the correct batch file can do this.
    Maybe a forum member that is can help you with one.
    Quote Quote  
  3. Something like:
    Code:
    ffmpeg.exe -i input.wav -codec copy -f segment -segment_time 5 -reset_timestamps 1 "output%%03d.wav"
    "reset_timestamps 1" may not be necessary.
    Quote Quote  
  4. If you have a lot of files, create a batch file (.bat in the folder with the files). It will check the entire folder for wav files, cut each of them into 5-second fragments, and place them in separate folders.
    Code:
    @echo off
    setlocal enabledelayedexpansion
    for %%f in (*.wav) do (
        set "filename=%%~nf"
        mkdir "!filename!" 2>nul
        ffmpeg -i "%%f" -f segment -segment_time 5 -c copy "!filename!\!filename!_%%03d.wav"
    )
    p.s. and put in the folder ffmpeg.exe if it is not in your PATH
    Quote Quote  
  5. Hi LISTYDOM How DO I CREATE A BATCH FILE THEN I have got over a 100 WAV audio files how do I do that then
    Quote Quote  
  6. I just wanted to test the codes.
    I could not get either the code or the .bat to work.
    I need a better guide & I believe the OP does too.
    Quote Quote  
  7. It seams to work, as was explained
    -put ffmpeg.exe into windows PATH or into the folder where wav files are
    -create bat file, by creating a txt file in notepad, paste that posted text and rename it to something.bat, put that bat into folder where those wav files are
    -run that bat by double clicking it or right click it and press Run
    Quote Quote  
  8. but I'd recommend to tweak ListyDoM script to just call a function instead of using enabledelayedexpansion, it is a good habit to call functions.
    Code:
    @echo off
    for %%f in (*.wav) do call :split_wav_files "%%f"
    echo press any key to exit&pause>nul&exit
    
    
    :split_wav_files <some wav file which becomes %1 in this function>
    set "filename=%~n1"
    mkdir "%filename%" 2>nul
    ffmpeg -i "%~1" -f segment -segment_time 1 -c copy "%filename%\%filename%_%%03d.wav"
    goto :eof
    Quote Quote  
  9. @ _Al_,
    The Code you posted worked fine.
    I did change the -segment_time 1 to -segment_time 5 to get the 5 seconds the OP wanted.

    The code or script ListyDoM did not work foe me.
    Quote Quote  
  10. If there is "!" character in names, it does not work, if using enabledelayedexpansion, otherwise not sure what is going on.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!