0

I would like to change the volume of a music track but only for specific time ranges. For example, I would like to apply a gain of -6dB between 0s to 1s ; and between 5s to 6s and leave the rest of the soundtrack untouched.

I have seen that I can access the data of the signal with AudioSegment(…).get_array_of_samples()

I tried to convert it to an numpy.array in order to divide it with a float (100.0) and getting it back with AudioSegment(…)._spawn() but the result is not meeting my expectations... (I even felt it increased the volume)

If required, I can provide a MWE but before, I wanted to verify my idea with some experienced people.

Best regards

Regman
  • 21
  • 3
  • I have the MWE prepared ; what is the best practice to share this without pasting all the code into the post ? – Regman Jul 04 '20 at 18:27

1 Answers1

0

The proposed approach is finally valid.

I have found that I had a mistake in the slices corresponding to [0,1] seconds and [5,6] seconds. Fixing the slices made the processing valid.

Regman
  • 21
  • 3