Created
November 15, 2012 02:02
-
-
Save tremby/4076178 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fadefactor is a short method which returns a float based on the one passed in | |
# audio is a bytearray | |
for i in range(fadeinframes): | |
offset = i * framesize | |
frame = str(audio[offset:offset + framesize]) | |
value = struct.unpack(frameformat, frame) | |
audio[offset:offset + framesize] = struct.pack(frameformat, | |
*(fadefactor(float(i) / fadeinframes) * v for v in value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment