topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 12:16 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Play wave file through secondary sound card?  (Read 9318 times)

trw

  • Guest
Play wave file through secondary sound card?
« on: December 13, 2007, 08:36 AM »
I'm using WinLIRC to receive IR commands and cause UICE to execute "qwave.exe soundfile.wav". By this method I'm able to cause various short wave files to play upon receipt of specific IR commands from a remote.  The problem is that these sounds are played through the default Windows sound device, whereas I want them to play through a secondary soundcard or external USB sound device. I've read that Winamp can play through alternate sound cards but it is too intrusive (opens and steals focus) and large (slow) for this application.  I found the following old forum post which I think hints how it can be done. Any advice or solutions will be greatly appreciated!

(from http://opensource.cr...04-March/007351.html)

"If you download the code from CVS (instructions at
http://www.openal.org/downloads.html), you'll find the source code for
"altest" in openal/demos/altest/common/altest.cpp.  During
initialization, you'll see a reference to enumeration -- that section
will show you how to use the context enumeration extension to enumerate
the various "devices" on your system.

These "devices" do not necessarily correspond with sound cards,
however.  For instance, I have a computer at work with an NVIDIA
nForce2 and a Creative Audigy 2 in it.  The devices enumerate and will
play back as follows:

Device Name / playback device
MMSYSTEM / whatever is the "preferred audio device" selected for Windows
DirectSound / "preferred audio device" as with MMSYSTEM
DirectSound3D / "preferred audio device" as with MMSYSTEM
NVIDIA nForce2 / always will play back on the nForce 2
Creative Audigy 2 / always will play back on the Audigy 2

On your system, if you have an nForce2 and a Creative card, then you'll
see explicit entries for those two cards on your device list.  Any card
that doesn't have its own accelerated OpenAL implementation will have
to be selected by using one of the generic devices, which will follow
the "preferred audio device" selection in Windows."

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Play wave file through secondary sound card?
« Reply #1 on: January 08, 2008, 04:15 PM »
Hi trw,
I don't have time to write it myself right now but here's a sketch for what I think would accomplish what you're after:
An autohotkey script that (1) changes the external USB device to default, (2) runs your qwave command, (3) changes the default device back to whatever it was. Autohotkey scripts for changing default device are available in this thread "Audio output device manager" https://www.donation...dex.php?topic=8218.0 . Maybe you see how to put steps (1)-(3) together based on that info?
« Last Edit: January 08, 2008, 04:17 PM by Nod5 »

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,069
    • View Profile
    • Donate to Member
Re: Play wave file through secondary sound card?
« Reply #2 on: January 08, 2008, 05:01 PM »
Not the neatest solution (and probably no better than WinAmp) but Apple QuickTime can play WAV files and also allows you to set the sound device.