Play last third of a wav file

조회 수: 2 (최근 30일)
AngelsaAtWar
AngelsaAtWar 2013년 3월 26일
this is part of a question I have to create a program for, I have no code just yet, but I was wondering how to play the last part of a wav file as asked: The second WAV file will have the last Hallelujah repeated three times (and no other sound). any help for this part will get me going in the right direction thanks.

채택된 답변

Youssef  Khmou
Youssef Khmou 2013년 3월 26일
편집: Youssef Khmou 2013년 3월 26일
hi, try :
sound(y(2/3:end,Fs); % with Fs the sampling frequency
% EDITED ANSWER
ok Walter is right the answer is not complete/wrong, here is the correct version :
% example :
data=load('gong.mat')
y=data.y;
Fs=data.Fs;
N=length(y);
sound(y(round(2/3*N):N),Fs); % round|ceil|floor
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 3월 26일
sound( y( round(2/3*end):end ), Fs)
AngelsaAtWar
AngelsaAtWar 2013년 3월 26일
Thank you very much for helping me on this....the file work great!!!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 3월 26일
You pretty much do have code for this. It's in your other question: my code in my answer. The code just needs slight adaptation.
  댓글 수: 1
AngelsaAtWar
AngelsaAtWar 2013년 3월 26일
you were also correct, it was a little bit of a correction to the code, but now I understand much more has matlab works with wav files thank you so much again. I really do appreciate your help.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by