×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how can I trim a wav file?

how can I trim a wav file?

how can I trim a wav file?

(OP)


using
 
data = wavread('1.wav')

I basically need something that will remove any silence before the sound kicks in.

something like this :

X = 0
while data(X) < 0.1
delete data(X)
X++

I don't know much about matlab except that the help filee is really vague on whiles and you can only delet files and not information on files, so i'm very stuck on this.

RE: how can I trim a wav file?

(OP)
actually that code wont work I have a better code/pseudo code i need syntax help with

same beginning

data  = wavread('1.wav')
X = 0
y = 0

WHILE data(X) < 0.1
X++
END WHILE

WHILE data(X) != NULL
data2(Y) =  data(X)
X++, Y++
END WHILE

this works better in theory i think.  not sure again about how to implemeent the whiles, or the NULL

RE: how can I trim a wav file?

(OP)
X=1;
Y=1;
while data(X) < 0.1
X = X + 1;
end
while X < 37000
data2(Y) =  data(X);
X = X + 1;
Y = Y + 1;
end

is what I have right now, i can't get the NULL thing to work, and also, the resulting data2 is arranged into columns for some reason...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources