noSilence               package:sound               R Documentation

_C_u_t _O_f_f _S_i_l_e_n_c_e _f_r_o_m _a _S_a_m_p_l_e _O_b_j_e_c_t

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

     Cut off silence or low noise at the beginning and/or at the end of
     a Sample object or a wav file.

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

     noSilence(s, level=0, start=TRUE, end=TRUE)

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

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

   level: non-negative numeric. Absolute values in the waveform matrix
          smaller than or equal to this value are regarded as silence. 

   start: logical. If 'TRUE', silence at the beginning of the sample
          will be cut off. 

     end: logical. If 'TRUE', silence at the end of the sample will be
          cut off. 

_D_e_t_a_i_l_s:

     For stereo samples, it is checked if the values of both channels
     are silence before the silence is cut off.

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

     a Sample object without those parts at the start and at the end of
     the original sample that are below the specified noise level.

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

     Matthias Heymann

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

     'cutSample'

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

     ## Not run: 
     s <- Sine(440,5)
     sound(s) <- sound(s)*matrix(seq(1,0,length=5*44100),nrow=1)
     sampleLength(s)
     play(s) # fade out
     s <- noSilence(s,level=.05)
     sampleLength(s)  # s is shorter now
     play(s)    # although you don't hear that the end is missing
     ## End(Not run)

