title: How to do fade-in sound in Python??
body: <p>def fade_in (snd, fade_length):
  '''doing a sound fade-in for that wave file'''
      new_snd = sound.copy(snd)</p>
  
  <pre><code>for sample in new_snd:
      snd_index = sound.get_index(sample)
      factor = 0
      snd_samp = sound.get_sample(snd, snd_index)
      if snd_index &lt;= fade_length:
          left = (sound.get_left(snd_samp) * factor)
          right = (sound.get_right(snd_samp) * factor)
          factor += 0.25
          sound.set_values(sample,int(left),int(right))
      else:
          left = sound.get_left(sample)
          right = sound.get_right(sample)
          sound.set_values(sample, int(left), int(right))
  
  return new_snd
  </code></pre>