Advertisement
Guest User

Untitled

a guest
May 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public void trimSilenceFromBeginning(){
  2. int leadingCount = 0;
  3. for (int i = 0; i < this.samples.length; i++){
  4. if (this.samples[i] == 0){
  5. leadingCount = leadingCount + 1;
  6. }
  7. else { break; }
  8. }
  9. int[] samples_ = new int[this.samples.length - leadingCount];
  10. for (int i = leadingCount; i < this.samples.length; i++){
  11. samples_[i] = this.samples[i];
  12. }
  13. this.samples = samples_;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement