Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] two sound cards

edited January 2013 in OpenSesame

Anyone have any experience using two sound cards in OpenSesame? Thanks for help/ suggestions!

Comments

  • edited 1:45PM

    Hi Wieske,

    Good to see you on the forum!

    In order to use multiple sound cards you will need to do a bit of inline scripting, because it's not supported through the synth and sampler items. One way (maybe not the best, as I personally don't have much experience with this) is to use PyAudio, which is an audio module that is included with OpenSesame. PyAudo let's you specify a device number for your output, which should allow you to use multiple cards at the same time.

    Cheers,
    Sebastiaan

    [pastebin:QbnjF4KH]

  • edited 1:45PM

    Thanks! It works using the code below to index the sounds cards.

    Now I am figuring out how to play to a specific speaker...


    import sys
    import pyaudio ## index the devices in the system p = pyaudio.PyAudio()
    count = p.get_device_count()
    devices = []
    for i in range(count):
    devices.append(p.get_device_info_by_index(i)) for i, dev in enumerate(devices):
    print "%d - %s" % (i, dev['name'])
  • edited 1:45PM

    Right, panning seems a bit more complicated than you would expect, using PyAudio and Wave. But the following should do the trick. It's a horribly inefficient way of panning, essentially looping through each chunk and setting one of the channels to 0 before playing it back. But as long as your computer keeps up, this shouldn't be an issue.

    [pastebin:q0JZ7hPM]

    Also see:

    Cheers!

  • edited 1:45PM

    Fantastic! Thanks for the reply! I have to admit I was hoping you would have some pointers after having spent an hour 'playing' with this issue. Does increase my appreciation for the pan function in synth- it is very nice and works really well for me for another experiment...

    One quick other question, do you happen to know if it is normal that the index for the output_device changes in different sessions? Not a big deal, just means you have to be aware and change the variable accordingly...

    Thanks again for your help and have a nice weekend!

  • edited 1:45PM

    One quick other question, do you happen to know if it is normal that the index for the output_device changes in different sessions?

    I personally have never worked with multiple sound cards, so I couldn't say. It's a bit odd, but I suppose it's nothing to worry about.

    Thanks again for your help and have a nice weekend!

    Good luck and same to you!

  • rizriz
    edited 1:45PM

    hi Wieske,

    I am facing the same challenge as you were I have multiple sound card and I would to play sound on different sound card using pyadio. Seems like you may already have the solution for this :). If could please share your information, it will be greatly appreciated .

    Thanks. Riz

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games