# Switching sounds on left or right speakers

**URL:** <https://psychtoolbox.discourse.group/t/switching-sounds-on-left-or-right-speakers/1184>\
**Category:** Uncategorized\
**Created:** [November 26, 2003, 8:27am UTC](https://psychtoolbox.discourse.group/t/switching-sounds-on-left-or-right-speakers/1184 "2003-11-26T08:27:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cristyho](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@cristyho](https://psychtoolbox.discourse.group/u/cristyho)\
**Post date:** [November 26, 2003, 8:27am UTC](https://psychtoolbox.discourse.group/t/switching-sounds-on-left-or-right-speakers/1184/1 "2003-11-26T08:27:15Z")

</div>

Hi,  
I would like to ask if MATLAB is capable of controlling the   
presentation of sounds (wav or beep) to just one speaker and switch   
between the two?  
  
WAVPLAY(y(:,2),Fs);  
would play sound from the 2nd channel of the wav file but on both   
speakers.  
  
WAVPLAY(y(:,:),Fs);  
would play both channels on their respective speaker separately.  
  
Is that a way to play channel 2 on the left speaker only??  
  
Thanks.  
  
Cristy

---

<div class="post-metadata">

**Author:** ![mshovman](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mshovman](https://psychtoolbox.discourse.group/u/mshovman)\
**Post date:** [December 5, 2003, 6:04pm UTC](https://psychtoolbox.discourse.group/t/switching-sounds-on-left-or-right-speakers/1184/2 "2003-12-05T18:04:34Z")

</div>

If the matrix passed to wavplay is Nx1 - it's played to both channels.  
Try the following (w is the wave):  
  
  
left = [w(:,1), zeros(size(w,1),1)];  
right = [zeros(size(w,1),1), w(:,2)];  
  
wavplay(left);  
wavplay(right);  
  
Good luck!
