I'm trying to split a WAV audio file into several 3 second segments.
I tried the following, but I get files with irregular sizes that are slightly above or under 3 seconds:
ffmpeg -i input.wav -c:a libvorbis -segment_time 3 -f segment output%d.ogg
My files look like this:
Duration: 00:00:03.01, start: 0.000000, bitrate: 125 kb/s
Duration: 00:00:03.01, start: 3.008435, bitrate: 132 kb/s
Duration: 00:00:02.99, start: 6.021224, bitrate: 129 kb/s
Duration: 00:00:02.99, start: 9.010794, bitrate: 130 kb/s
Duration: 00:00:03.01, start: 12.000363, bitrate: 128 kb/s
Duration: 00:00:03.00, start: 15.005896, bitrate: 134 kb/s
Duration: 00:00:03.02, start: 18.005624, bitrate: 135 kb/s
Duration: 00:00:02.98, start: 21.031474, bitrate: 131 kb/s
Unfortunately the difference is significant enough that when I later try to chain them together, the gaps between some of them are clearly perceivable.
I found these other two questions that mention similar problems, but they're converting video files not audio.
ffmpeg not splitting into EXACT same length chunks
How to get equal segment times using ffmpeg?
Is there something that could be used for audio files instead?