Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I trim a wav file?

Status
Not open for further replies.

badman

Computer
Dec 6, 2004
4
GB


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.
 
Replies continue below

Recommended for you

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
 
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...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top