1

I was looking for a simple fade-in/fade-out in the documentation, but wasn't able to find anything.

Is is it possible to make a fade-in/fade-out on a looping signal with superpowered?

//edit

I am using the CrossExample and I loop sounds in small pulses. I wanna apply a fade-in and fade-out on the looping signal with superpowered.

neodymium
  • 67
  • 7

2 Answers2

2

Just set the volume parameter of the player's process() method to 1.0f or 0.0f. The player will smoothly fade within one buffer. For longer fading, dynamically adjust the volume parameter.

Gabor Szanto
  • 1,329
  • 8
  • 12
  • I tried, but it doesn't really work. I start the player with a silent file, then I put a whitenoise filter on it. Then I "cut" the lower frequencies with the frequencyDomain. After that I have the output. In the java part, I start and stop it, with the help of handler.postDelayed for stopping/starting it after a specific amount of time. The problem is that it doesn't work when I want to fade in and fade out everytime I start and stop the player. Between stopping the player and starting it again there is also a pause. – neodymium May 31 '17 at 12:24
  • 1
    Control volume, play and pause in the native layer, in the audio processing callback. So when your native layer gets a pause message, then slowly decrease volume in every audio processing callback turn for a second, after reaching 0 with volume pause the player. – Gabor Szanto Jun 02 '17 at 07:32
  • Thanks :) Does it also work, if the signals are e.g. 10ms or 50ms long? In which method should I decrease the volume? – neodymium Jun 02 '17 at 08:27
  • I also still have play and pause in the native layer. I only execute the "onPlayPause" method within handler.postDelayed for getting a "pulsing effect". – neodymium Jun 06 '17 at 06:24
  • If a signal is just a few ms long, then it might be just a few buffers long. – Gabor Szanto Jun 07 '17 at 07:02
0

Depending on the complexity of the signal, you could probably apply a Superpowered3BandEQ and gradually decrease gain toward -40dB (kill point).

ekscrypto
  • 3,718
  • 1
  • 24
  • 38