Stereo sound doesn't behave as expected

2 次查看(过去 30 天)
[road,fs]=wavread('road.wav'); % loads “the long and winding road” clip
left=road(:,1);
right=road(:,2);
soundsc(left,fs) % plays left channel as mono
soundsc(right,fs) % plays right channel mono
Why the sound doesn't divided into left channel (Left ear) and right Channel (right ear) ?
  2 个评论
Thomas
Thomas 2012-5-30
Do you mean, when you play soundsc(left,fs) it should only come from the left speaker?
chewkaisheng
chewkaisheng 2012-5-30
yup:)
how to if just the sound come from the only left speaker or only the right speaker??

请先登录,再进行评论。

回答(2 个)

Thomas
Thomas 2012-5-30
MAybe you need something like this
[road,fs]=wavread('road.wav');
pad=zeros(length(road),1); % blank channel
left=[road(:,1),pad]; % add blank channel so right is silent
right=[pad,road(:,2)]; % add blank channel so left is silent
soundsc(left,fs) % sound only from left
soundsc(right,fs) % sound only from right
  5 个评论
Walter Roberson
Walter Roberson 2012-5-30
http://www.answerbag.com/q_view/2147756
chewkaisheng
chewkaisheng 2012-5-31
Thomas Anthony and Walter Roberson
Thank you so much !!!! :)
have a nice day!

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2012-5-30
When you soundsc() a single column of data, it is sent to both channels. Notice there is no possibility to select whether you are sending to left channel or to right channel when you soundsc()
hint:
soundsc( [left, zeros(size(left))], fs)
  1 个评论
chewkaisheng
chewkaisheng 2012-5-30
so, is there any possible suing other command to send it to left or right only?
Thanks!!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by