Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import wave
  2. import struct
  3.  
  4.  
  5. i = int(input())
  6. source = wave.open("in.wav", mode="rb")
  7. dest = wave.open("out.wav", mode="wb")
  8. frames_count = source.getnframes()
  9.  
  10. data = struct.unpack("<" + str(frames_count) + "h", source.readframes(frames_count))
  11. newdata = tuple(data[j] for j in range(frames_count) if j % i != i - 1)
  12.  
  13. newframes = struct.pack("<" + str(len(newdata)) + "h", *newdata)
  14. dest.writeframes(newframes)
  15. source.close()
  16. dest.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement