HussainLatiff Banuka commited on
Commit
1d02d7d
Β·
verified Β·
1 Parent(s): acf7656

adding the mixing.py file (#9)

Browse files

- adding the mixing.py file (777cc72ccba78520680481716845ab46128708fb)


Co-authored-by: Banuka Nanayakkara <Banuka@users.noreply.huggingface.co>

Files changed (1) hide show
  1. mixing.py +14 -0
mixing.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pydub import AudioSegment
3
+
4
+ # Using raw strings to avoid issues with backslashes
5
+ sound1 = AudioSegment.from_wav(r"audio\mixkit-distant-explosion-1690.wav")
6
+ sound2 = AudioSegment.from_wav(r"audio\videoplayback_mastered (1).wav")
7
+
8
+ # mix sound2 with sound1, starting at 1000ms into sound1)
9
+ output = sound1.overlay(sound2, position=1000)
10
+
11
+
12
+ # save the result
13
+ output.export(r"mixedAudio\mixed_haptic_audioFile.wav", format="wav")
14
+