Help - Search - Members - Calendar
Full Version: Sound Device selection Script
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
pmshah1946
I am not a programmer but here is the only place where I might be able to find some help to solve my problem.

I have recently purchased Vosky Call Center (VCC) for use with regular telephone instrument & call forwarding. My problem is as follows.

I have tried all versions of VCC but everytime the application starts it resets the default Sound Device in Skype (all versions) to Actiontech Voice Gateway (AVG) 1 or 2. I have to open the skype window & change the selection to VCC everytime I boot up the PC.

I know the problem is definitely with VCC software and not Skype. I have tried it to the extent of absolutely clean install of the OS. VCC sound device selection is not available in Skype until VCC software is started. AVG sound device selection is available even without the VCC device connected to the pc. For proper functioning of the VCC device - as advertised - VCC sound device has to be selected in Skype & then it functions well.

I was wondering if there was any way to script a batch file so that I could change the Sound Device to VCC when the PC starts up?

Any and all help would be appreciated.

Avo Nappo
> I was wondering if there was any way to script a batch file so that I could change the
> Sound Device to VCC when the PC starts up?

If you just want to change AudioIn and AudioOut settings in Skype from comandline, try the attatched program.

Usage:

setskypeaudiodevice <devicename>
- sets both AudioIn and AudioOut devices to <device>

setskypeaudiodevice <"devicename with spaces in it">
- if device name contains spaces, enclose the device name in quotes.

setskypeaudiodevice
- without parameter, both AudioIn and AudioOut devices are set to 'Windows default device'

If you want to set AudioIn and AudioOut to different devices, just run setskypeaudiodevice
twice, with different parameters.

Delphi source:

CODE


Program SetSkypeAudioDevice;
{$APPTYPE CONSOLE}

uses
  SysUtils,
  ActiveX,
  SKYPE4COMLib_TLB;

Var
   Skype : TSkype;
   Key   : Char;

Var
     DeviceName   : String;
     Cmd          : ICommand;

Begin
  ActiveX.CoInitialize(nil);
  Skype := SKYPE4COMLib_TLB.TSkype.Create(nil);

  Try
   Writeln('Connecting to Skype..');
   Skype.Attach(6, True);
   // 1st parameter - protocol number
   // 2nd parameter - wait for attach
  Except
   Writeln('Skype client is not running or logged in.');
  End;

  if ParamCount <> 0 Then
   DeviceName := ' ' + ParamStr(1)
  Else Begin
   DeviceName := '';
   Writeln('Setting audio to Windows default device');
  End;

  Cmd := Skype.Command[1, 'SET AUDIO_IN' + DeviceName, '', True, 5000];
  Try
   Skype.SendCommand(Cmd);
   Writeln(Cmd.Reply + ' ' + DeviceName);
  Except
  End;

  Cmd := Skype.Command[2, 'SET AUDIO_OUT' + DeviceName, '', True, 5000];
  Try
   Skype.SendCommand(Cmd);
   Writeln(Cmd.Reply + ' ' + DeviceName);
  Except
  End;

  Skype.Destroy;
End.

pmshah1946
I can''t express enough thanks !!!!! If it works the way you have mentioned it would be a life saver.

I have 2 questions though.

1. Will this work on allthe versions of Skype?
2. What OSes are supported?

Thank you once again.

I have a suggestion for the Skype Forum moderators. Why don't you make it a sticky? There are a whole lot of people who are suffering from this anomaly in using "Skype Certified" VoSKY Call Center.

PS. The utility worked perfectly. What I need now is some way to maximise the volume settings also automaticlly. Any ideas / utilities?
viking2ev
I have tried to run the utility from DOS, but it crashes (WINXP SP2)..... sadsmile.png
pmshah1946
QUOTE(viking2ev @ Tue May 22 2007, 01:53) [snapback]397739[/snapback]

I have tried to run the utility from DOS, but it crashes (WINXP SP2)..... sadsmile.png

You haveto run the utility once both your Skype & Vosky softwarearerunning. I too am using XP - SP2. I have put the link in a skype.cmd file in the stsrtup list.

I am also using a freeware utility called sleep.exe. I delay the execution of utility by 50 seconds which ensures that both Skype & Vosky are running & the basic boot up process is complete. Here are the details of the .cmd file.

================
c:\windows\system32\cmdow @ /hid
c:\windows\system32\sleep 50
"C:\Program Files\SetSkypeAudioDevice\SetSkypeAudioDevice.exe" "VoSKY Call Center"
exit
==============

Hope it solves your problem.

viking2ev
QUOTE(pmshah1946 @ Wed May 23 2007, 05:29) [snapback]398260[/snapback]

You haveto run the utility once both your Skype & Vosky softwarearerunning. I too am using XP - SP2. I have put the link in a skype.cmd file in the stsrtup list.

I am also using a freeware utility called sleep.exe. I delay the execution of utility by 50 seconds which ensures that both Skype & Vosky are running & the basic boot up process is complete. Here are the details of the .cmd file.

================
c:\windows\system32\cmdow @ /hid
c:\windows\system32\sleep 50
"C:\Program Files\SetSkypeAudioDevice\SetSkypeAudioDevice.exe" "VoSKY Call Center"
exit
==============

Hope it solves your problem.


Both were running. Still crashes sadsmile.png sadsmile.png
mandar333
[quote name='Avo Nappo' date='Fri May 18 2007, 12:25' post='396444']
> I was wondering if there was any way to script a batch file so that I could change the
> Sound Device to VCC when the PC starts up?

If you just want to change AudioIn and AudioOut settings in Skype from comandline, try the attatched program.

--------------------------------------------------------------------------------------------------------------------------------

I have downloaded the program, but it fails to open. A window pops up saying: SetSkypeAudioDevice has stopped working; I'm given the option to close program or have Windows search for a solution on the internet.
I'm running Vista 32-bit, Skype 2.5.0.154, and Call Center 2.2.2.12 if that makes a difference.

Also, I noticed that in Device Manager under Sound, video & game controllers, I have both VoSKY CC and VoSKY Call Center. I'm assuming this is the reason why I'm getting duplicates of "Speakers (VoSKY Call Center)" in my Skype audio settings.

I've uninstalled & reinstalled both Skype and Call Center so many times. Any suggestions as to how to remedy this situation for good?
Kacchua
I am also using this to set up the audio settings for a D-Link Voip adapter and it works great. Thanks a bunch.
pipetawer
Does anyone has a copy of the app SetSkypeAudioDevice.zip?? The link is dead. sadsmile.png

Thanks!

Felipe
Avo Nappo
> The link is dead.

Indeed. Posting it anew.
pipetawer
Avo Nappo, thanks for the code. I ported it to C# and added some extra features:

- Sleep timer on the same file
- Able to modify Audio In / Audio Out / Ringer independently.

Attached is the executable (plus a DLL that needs to be on the same directory).

Source Code:
CODE
using System;
using System.Threading;
using SKYPE4COMLib;

namespace SkypeAudioSettings
{
  class SetAudio
  {
    private static Skype Skype = new SkypeClass();
    private static string DeviceNameIn;
    private static string DeviceNameOut;
    private static string DeviceNameRinger;

    private static string GetDeviceName(string deviceName, string type)
    {
      if (deviceName != string.Empty)
      {
        Console.WriteLine("Trying to setup " + type + " to " + deviceName);
        return " " + deviceName;
      }
      else
      {
        Console.WriteLine("Trying to setup " + type + " to Windows default device");
        return "";
      }
    }

    [STAThread]
    static void Main(string[] args)
    {
      if (args.Length == 0)
      {
        Console.WriteLine("Usage: SkypeAudioSettings <pause secs> [<AudioIn> <AudioOut> <Ringer>]");
      }
      else
      {
        try
        {
          Thread.Sleep(Convert.ToInt32(args[0])*1000);

          try
          {
            Console.WriteLine("Connecting to Skype...");
            Skype.Attach(6, true);

            DeviceNameIn = GetDeviceName(args[1],"AudioIn");
            DeviceNameOut = GetDeviceName(args[2],"AudioOut");
            DeviceNameRinger = GetDeviceName(args[3],"Ringer");

            Skype.Settings.AudioIn = DeviceNameIn;
            Skype.Settings.AudioOut = DeviceNameOut;
            Skype.Settings.Ringer = DeviceNameRinger;

            Console.WriteLine("Skype Current Settings");
            Console.WriteLine("----------------------");
            Console.WriteLine("Audio In Device : " + Skype.Settings.AudioIn.ToString());
            Console.WriteLine("Audio Out Device: " + Skype.Settings.AudioOut.ToString());
            Console.WriteLine("Auto Away       : " + Skype.Settings.AutoAway.ToString());
            Console.WriteLine("Ringer Device   : " + Skype.Settings.Ringer.ToString());
            Console.WriteLine("AEC             : " + Skype.Settings.AEC.ToString());
            Console.WriteLine("AGC             : " + Skype.Settings.AGC.ToString());
            Console.WriteLine("PC Speaker      : " + Skype.Settings.PCSpeaker.ToString());
            Console.WriteLine("Video In Device : " + Skype.Settings.VideoIn.ToString());

          }
          catch (Exception ex)
          {
            Console.WriteLine("Skype client is not running or logged in. [Skype Error: " + ex.Message + "]");
          }
        }
        catch
        {
          Console.WriteLine("Error: <pause secs> parameters must be a number only.");
        }
      }
    }
  }
}


By the way, I did solve my issues with VoSky Call Center:

The way it works is:
Usage: SkypeAudioSettings <pause secs> [<AudioIn> <AudioOut> <Ringer>]

<pause secs>: Number of seconds to pause before changing the settings to allow skype and VCC to fully load.
<AudioIn>: Device to use for audio in, for our purpose should be "VoSKY CC 1" (including the colons)
<AudioOut>: Device to use for audio out, for our purpose should be "VoSKY CC 2"
<Ringer>: Device to use for the ringer, for our purpose should be "VoSKY CC 2"

So an example would be:
c:\SkypeAudio.exe 10 "VoSKY CC 1" "VoSKY CC 2" "VoSKY CC 2"

THANKS!

EDIT: Must be logged in to download
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.