Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: SoX' trim writes metadata/tags. How to disable? (Read 1080 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SoX' trim writes metadata/tags. How to disable?

I am trimming audio files that need to have no metadata to be able to be used in machine learning. I trim these files with SoX using the following command:

Code: [Select]
sox input.wav input_trim.wav trim 1300000s 100000s

This creates a trimmed WAV file that maintains the original sample rate and bit depth. However, it seems to write some metadata that makes the file unusable. I have to open the file in Audacity and export it to get a "clean" and working file.

Is it possible to tell SoX to write no metadata or tags to the output so that I do not need to do the Audacity procedure?

Re: SoX' trim writes metadata/tags. How to disable?

Reply #1
I'm not sure how to do this with Sox, but here's an example with ffmpeg:
Code: [Select]
ffmpeg -i input.wav -c:a copy -ss 1300000 -t 100000 -bitexact output.wav

Re: SoX' trim writes metadata/tags. How to disable?

Reply #2
I'm not sure how to do this with Sox, but here's an example with ffmpeg:
Code: [Select]
ffmpeg -i input.wav -c:a copy -ss 1300000 -t 100000 -bitexact output.wav
Thank you! I will try it out asap.

Re: SoX' trim writes metadata/tags. How to disable?

Reply #3
You can also try
Code: [Select]
sox input.wav -t wavpcm input_trim.wav trim 1300000s 100000s

Re: SoX' trim writes metadata/tags. How to disable?

Reply #4
I'm not sure how to do this with Sox, but here's an example with ffmpeg:
Code: [Select]
ffmpeg -i input.wav -c:a copy -ss 1300000 -t 100000 -bitexact output.wav
Thank you! I will try it out asap.
It threw error messages saying that nothing was written to the file. I apologise for not copying and pasting the messages so that we can come up with a solution.