normalize               package:sound               R Documentation

_R_e_s_c_a_l_e _t_h_e _R_a_n_g_e _o_f _a _S_a_m_p_l_e _t_o [-_1,_1]

_D_e_s_c_r_i_p_t_i_o_n:

     Multiply the waveform of a Sample object or a wav file with a
     positive constant so that the maximum absolut value becomes 1, or
     any other specified constant.

     Use this command before saving or playing a Sample object to avoid
     cracks in the sound caused by parts in the waveform that exceed
     the range [-1,1].

_U_s_a_g_e:

     normalize(s, level=1)

_A_r_g_u_m_e_n_t_s:

       s: a Sample object, or a string giving the name of a wav file. 

   level: a number between 0 and 1 specifying the desired maximum
          absolute value of the waveform. 

_V_a_l_u_e:

     a Sample object with the specified maximum absolut value of the
     waveform.

_A_u_t_h_o_r(_s):

     Matthias Heymann

_S_e_e _A_l_s_o:

     'Ops.Sample', 'center'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     s <- .6*Sine(440,1)
     plot(s)
     plot(normalize(s)) # now it uses the full range
     play(s)
     play(normalize(s)) # this one is louder
     ## End(Not run)

