Spaces:
Runtime error
Runtime error
Update
#14
by Banuka - opened
mixing.py
CHANGED
|
@@ -2,13 +2,14 @@ import os
|
|
| 2 |
from pydub import AudioSegment
|
| 3 |
|
| 4 |
# Using raw strings to avoid issues with backslashes
|
| 5 |
-
sound1 = AudioSegment.
|
| 6 |
-
sound2 = AudioSegment.
|
| 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="
|
|
|
|
| 14 |
|
|
|
|
| 2 |
from pydub import AudioSegment
|
| 3 |
|
| 4 |
# Using raw strings to avoid issues with backslashes
|
| 5 |
+
sound1 = AudioSegment.from_mp3(r"audio\540553_badoink_bass-sine-pulse (mp3cut.net).mp3")
|
| 6 |
+
sound2 = AudioSegment.from_mp3(r"audio\y2mate.is - Cinematic Boom Sound Effect-_ttHanoHTL4-192k-1710149220_mastered.mp3")
|
| 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="mp3")
|
| 14 |
+
|
| 15 |
|