Skip to content

Commit

Permalink
Update the instruction to implement audio augmentation using tourchau…
Browse files Browse the repository at this point in the history
…dio.sox_effects
  • Loading branch information
Le Vu Linh Chi authored and Le Vu Linh Chi committed Jan 2, 2025
1 parent 6217e24 commit d735f4a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ waveform, sample_rate = torchaudio.load("path_to_audio_file")
Step 4: Define the SoX Effects and apply the effects to input audio. In this example, I apply time_stretch, loudness, and high-pass filter adjustment.

effects = [
["tempo", "1.25"], # Increase the playback speed (tempo) by 25%
["gain", "10"], # Amplify the audio by 10 dB
["highpass", "1000"], # Apply a high-pass filter with a cutoff frequency of 1000 Hz
["tempo", "1.25"], # Increase the playback speed (tempo) by 25%
["gain", "10"], # Amplify the audio by 10 dB
["highpass", "1000"], # Apply a high-pass filter with a cutoff frequency of 1000 Hz
]

augmented_waveform, augmented_sample_rate = sox_effects.apply_effects_tensor(
waveform,
sample_rate,
effects
waveform,
sample_rate,
effects
)

Step 5: Save the Augmented Audio
Expand Down

0 comments on commit d735f4a

Please sign in to comment.