in speech editing i am receiving an error using sound. ??? Error using ==> playsnd Data must have one or two columns. Error in ==> sound at 58 playsnd(y,fs,bits); is there any problem with sound function?

yfirst= y(1:24000);
ysecond=y(24001:48000);
save anjali ysecond yfirst -ascii
load anjali -ascii
t=0:1/fs:length(anjali)/fs-1/fs;
pause(2)
sound(anjali,fs);

 Accepted Answer

I suspect that if you check, you will find that anjali is either 24000 or 48000 columns, possibly with two rows. sound() requires that it be either one or two columns.
If you are trying to use those values as two channels, then you should just be using
anjali = reshape( y(1:48000), 24000, 2 );
sound(anjali, fs);
with none of that save and load.

5 Comments

i want to give 2 second pause between my voices then play back. it is not giving playing back.
how can i change the code so that it can play back my voice?
How do you input your voice in the first place? How are you setting "y" ?
There is no way to encode a "pause" inside a sound array. You can encode silence, but not a pause. Silence is encoded as 0.
yfirst = y(1:24000);
ysecond = y(24001:48000);
silence = zeros(2 * fs, 1); %2 seconds
anjali = [yfirst(:); silence(:); ysecond(:)];
sound(anjali, fs);
[y,fs,nbits]=wavread('C:\Users\HP\Desktop\angel_48k_stereo.wav');
sound(y,fs)
t=0:1/fs:length(y)/fs-1/fs;
i want that first i can listen this voice then after silence of 2 seconds i can listen back this voice.
silence = zeros(2 * fs, size(y,2)); %2 seconds
anjali = [y; silence; y];
sound(anjali, fs);

Sign in to comment.

More Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!