Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
loubbrad committed Apr 16, 2024
1 parent bfbb896 commit 4b7fd4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions amt/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
FRAMES_PER_SECOND = SAMPLE_RATE // HOP_LENGTH # 10ms per audio frame
TOKENS_PER_SECOND = SAMPLE_RATE // N_SAMPLES_PER_TOKEN # 20ms per audio token


def pad_or_trim(array, length: int = N_SAMPLES, *, axis: int = -1):
"""
Pad or trim the audio array to N_SAMPLES, as expected by the encoder.
Expand Down Expand Up @@ -50,6 +51,7 @@ def pad_or_trim(array, length: int = N_SAMPLES, *, axis: int = -1):

return array


# Refactor default params are stored in config.json
class AudioTransform(torch.nn.Module):
def __init__(
Expand Down

0 comments on commit 4b7fd4f

Please sign in to comment.