I am new to Python, please bear with me. I have been able to get so far with the help of Google/StackOverflow and youtube :). So I have a long (2 hours) *.wav file. I want to mute certain parts of that file. I have all of those [start], [stop] timestamps in the "Timestamps.txt" file in seconds. Like this:
0001.000 0003.000
0744.096 0747.096
0749.003 0750.653
0750.934 0753.170
0753.210 0754.990
0756.075 0759.075
0760.096 0763.096
0810.016 0811.016
0815.849 0816.849
What I have been able to do is read the file and isolate each tuple. I have just output the first tuple and printed it to check if everything looks good. It seems that the isolation of tuple works :) I plan to count the number of tuples (which is 674 in this case) and put in a 'for loop' according to that count and change the start and stop time according to the tuple. Perform the loop on that single *.wav file and output on file with muted sections as the timestamps. I have no idea how to implement my thinking with FFMPEG or any other utility in Python e.g pydub. Please help me.
with open('Timestamps.txt') as f:
data = [line.split() for line in f.readlines()]
out = [(float(k), float(v)) for k, v in data]
r = out[0]
x= r[0]
y= r[1]
#specific x and y values
print(x)
print(y)