Different output to different speakers?

BlitzMax Forums/BlitzMax Programming/Different output to different speakers?

Algo(Posted 2008) [#1]
I'm looking to knock up a cheap multiroom audio solution.

Anyone know if it's possible to get a different output to different speakers? Maybe using a 5 or 7.1 sound card?


ImaginaryHuman(Posted 2008) [#2]
Do you mean beyond just 2 stereo channels?


GfK(Posted 2008) [#3]
Rob Farley knows about this sort of stuff.


Algo(Posted 2008) [#4]
Yes. Ideally I'd like to stream music to 5 different rooms.

Just wondered if anyone was already using max to do such a thing.


Shambler(Posted 2008) [#5]
Is that 5 different musics to 5 different rooms or the same music to 5 rooms?


Algo(Posted 2008) [#6]
Just being able to play one track at a time would be fine, as long as I could select which speakers it played through. So I don't disturb anyone in a different room.

I guess there must be some sort of manual switch you can buy, but I'd like to do it in software so I can build a fancy 3D UI to control it all.


Shambler(Posted 2008) [#7]
Something like this then http://www.mcmelectronics.com/product/50-6200


Digital Anime(Posted 2008) [#8]
Using a quancom relais interface might help, 8 switches . I already made something for it, and the library (Windows/Linux only) is easy to use.
You just need to be a bit handy to connect the cables the right way yourself.



Go to http://www.quancom.com and look for USBREL8

Code example
' Relaishandler v1.0 for Quancom USBREL8LC USB Relais interface

' Written by Mark Gerritsen

' Use :

' relais (x, x, x, x, x, x, x, x) to activate relais
' x can be either 1 or 0 and each x handles 1 relais


' Load Quancoms Qlib library 
dll = LoadlibraryA ("qlib32")

If dll=Null
 RuntimeError "Unable to load library"
 End
EndIf

Global QAPIExtOpenCard:Int (cardid:Int, devnum:Int) "win32"
Global QAPIExtCloseCard (cardhandle:Int) "win32"
Global QAPIExtWriteDO32 (cardhandle:Int, channel:Int, value:Int, mode:Int) "win32"
Global handle:Int

QAPIExtNumOfCards = GetProcAddress(dll, "QAPIExtNumOfCards")
QAPIExtOpenCard = GetProcAddress(dll, "QAPIExtOpenCard")
QAPIExtWriteDO32 = GetProcAddress(dll, "QAPIExtWriteDO32")
QAPIExtCloseCard = GetProcAddress(dll, "QAPIExtCloseCard")

Local cardnumber:Int = 0

While handle = 0
If cardnumber > 8
RuntimeError "Unable find card"
  End
EndIf
handle = QAPIExtOpenCard(67,cardnumber)
cardnumber = cardnumber + 1
Wend

' Reset Relais interface
relais(0,0,0,0,0,0,0,0)

Function relais(out1:Int,out2:Int,out3:Int,out4:Int,out5:Int,out6:Int,out7:Int,out8:Int)
Local value = 0
If out1 = 1 Then value = value + 1
If out2 = 1 Then value = value + 2
If out3 = 1 Then value = value + 4
If out4 = 1 Then value = value + 8
If out5 = 1 Then value = value + 16
If out6 = 1 Then value = value + 32
If out7 = 1 Then value = value + 64
If out8 = 1 Then value = value + 128
Print value
QAPIExtWriteDO32(handle,0,value,0)
QAPIExtCloseCard(handle)
End Function



Algo(Posted 2008) [#9]
Thanks. Has given me a few ideas.