MATLAB Answers

a a
0

audio compression (shorten an audio file)

Asked by a a
on 4 Dec 2018 at 11:06
Latest activity Commented on by a a
on 10 Dec 2018 at 7:51
I want to compress an audio file to make it shorter to put in a game for sound effects. I use the following:
[y,Fs]=wavread('blast.wav');
t1=0;% start time
t2=2;% end time
yNew=y((Fs*t1+1):Fs*t2,1);
wavwrite(yNew,Fs,'soundShort.wav');
The compression is fine and 'soundShort.wav' can play. But command sound(wavread('soundShort.wav')) no longer has any sound, though it's runnable. I wonder what goes wrong.

  13 Comments

ok. after further testing, actually sound(y,Fs) has a sound on win10 but doesn't on winXP. what's wrong with winXP on this point?
http://pcauthorities.com/windows-xp/how-to-troubleshoot-sound-problems-in-windows-xp/
thank you. after reading it, i still don't know what went wrong for my winxp. on my winxp, 'beep' has a sound while 'sound(beep)' doesn't.

Sign in to comment.

0 Answers