If the difference-to-length ratio is small enough, maybe the speed effect would be enough - just requires a bit of math to work out exactly. Which solution is best would depend on exactly what is and is not important to you: * Speed alters pitch but can get an exact length. * Stretch and tempo can get the length but alter sound quality (more on these below). * Delays at points of relative silence may also be used but would require more work (more on this below also). Stretch and tempo alter sound quality in different ways, but both can be fine-tuned. Also their factor parameters are inverses: stretch 2 makes a file twice as long, as does tempo .5. For tempo, -s may help you if you are dealing with speech more than with complex sounds. (Aside: The person that said you aren't telling the whole story was quite possibly asking for information like that - type of sound, range of file length differences, etc.) The delay idea is both more complex and, I think, less likely to be what you want; but it involves inserting delays at acceptable points in the file to extend its length. This would probably be better done with a GUI sound editor, since I rather doubt something like "trim 0 .5 delay .05 : restart" would yield anything palatable. :) On Tue, Jan 14, 2025 at 12:48:45AM +0100, Thomas Barth via Sox-users wrote: Am 2025-01-13 21:19, schrieb Jan Stary: > On Jan 13 20:07:12, sox-users@xxxxxxxxxxxxxxxxxxxxx wrote: > > I use sox for converting and merging vox-files in a shell script. But > > the > > vox files often have different duration in seconds and I want to make > > sure > > that the shorter file always has the duration of the longer file > > before > > merging. > > Why? You are not telling the whole story. My fantasy story for you is: I work for the German secret service and monitor telephone conversations. The VOX files contain the recordings from side A and B respectively. Unfortunately, the technology is not perfect. For some reason, the recording of side A is usually somewhat slower, probably due to asynchronous processes in the background. In a 42-minute conversation, the difference _can_ be up to 20 seconds. That's why I try to stretch the recording with the shorter duration to the duration of the longer recording in order to get the dialog in sync. The individual files are mono and with the merging it remains mono. I had already tried the tempo option, but that didn't work at all. Stretching is not worthwhile when the difference is so small. A certain tolerance can be taken into account. However, I will make it dependent on the length in future. chatgpt is an ideal helper (albeit with flaws) who doesn't ask superfluous questions and always tries to offer individual solutions and even spreads good vibes. I can't say that your text puts me in a good mood ;-) But thank you for taking the trouble to reply. It would have been your chance to show that humans can still be smarter than AI :) I'll keep experimenting with it until the result is perfect. -- Doug Lee dgl@xxxxxxxx http://www.dlee.org "There are no guarantees. From a standpoint of fear, none are strong enough. From a standpoint of love, none are necessary." - from Emmanuel's Book II _______________________________________________ Sox-users mailing list Sox-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/sox-users