# 2 simultaneous movies on two separate audio outputs

**URL:** <https://psychtoolbox.discourse.group/t/2-simultaneous-movies-on-two-separate-audio-outputs/639>\
**Category:** Uncategorized\
**Created:** [July 14, 2009, 3:52pm UTC](https://psychtoolbox.discourse.group/t/2-simultaneous-movies-on-two-separate-audio-outputs/639 "2009-07-14T15:52:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [July 14, 2009, 3:52pm UTC](https://psychtoolbox.discourse.group/t/2-simultaneous-movies-on-two-separate-audio-outputs/639/1 "2009-07-14T15:52:15Z")

</div>

Dear all,  
  
after using PTB for some experiments in the visual domain I would now like to add auditory information. Specifically, I would like to play simultaneously 2 movies (which is not a problem) but would like to have the audio output on two different output lines i.e. one movie on the left ear, one on the right.  
  
I guess it would be possible to load in the file (.mov - QuickTime) into matlab (since I’m using windows, mmreader should work) and change the audio there (set e.g. the 2nd column of the audio to zeros). But I guess I would have to first convert that to .avi and then convert back to .mov for PTB?  
  
So my question is if there is a better way to define the audio output in PTB?  
  
Help is very much appreciated!  
Barbara  
  
--   
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate  
für nur 19,99 Euro/mtl.!\* [http://portal.gmx.net/de/go/dsl02](http://portal.gmx.net/de/go/dsl02)

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [July 18, 2009, 11:05am UTC](https://psychtoolbox.discourse.group/t/2-simultaneous-movies-on-two-separate-audio-outputs/639/2 "2009-07-18T11:05:00Z")

</div>

Maybe before running anything you could split off the audio of both  
movies (on windows use something like virtualdub (you can edit the  
audio of a movie without touching the video). then:  
  
- if you always run the same two movies together, merge those two  
audiofiles so that one is on one channel and the other one the other,  
then add it back to one of the movies. Delete all sound from the  
other. Playing together will then work properly.  
  
- if random combinations, delete all audio from the movies. Then load  
the two movie and the two audio files and play as wanted (think that  
should work with PTB, wouldn't know exactly how).  
  
Note that virtualdub can be scripted and called from matlab using  
system() or simply !  
  
Hope this gives you some ideas.  
  
Best,  
Diederick  
  
On Fri, Jul 17, 2009 at 11:36 PM, Mario  
Kleiner\<[mario.kleiner@...](mailto:mario.kleiner@...)\> wrote:  

> \>  
> \>  
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Barbara Haendel" \<B.Haendel@...\>  
> \> wrote:  
> \>  
> \>\> I guess it would be possible to load in the file (.mov - QuickTime) into  
> \>\> matlab (since Iâ€™m using windows, mmreader should work) and change the  
> \>\> audio there (set e.g. the 2nd column of the audio to zeros). But I guess I  
> \>\> would have to first convert that to .avi and then convert back to .mov for  
> \>\> PTB?  
> \>  
> \> Hi Barbara  
> \>  
> \> That's the way to go. PTB currently doesn't have a way to assign specific  
> \> speakers to specific movies, so you'll need to properly prepare the movies  
> \> as you suggested. The .mov and .avi are just containers, Quicktime can also  
> \> read .avi's if you encode with a suitable codec.  
> \>  
> \> Theoretically you could also set the stereo left/right balance settings of  
> \> your movies in the Quicktime player, but at least on os/X 10.4.11 this only  
> \> had an effect in the Quicktime player, but not in Psychtoolbox, at least  
> \> with the one movie i tested.  
> \>  
> \> -mario  
> \>  
> \>
