CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Question Operating system volume control

    I had a problem;

    I want to write a code that controls the operating system sound volume. The operating system which I am working with is Win XP pro.

    I tried to use:
    system.setVolume() and system.getVolume(). It does not work.

    Thanx

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Operating system volume control

    strangely enough it doesnt!; seeing as the System class doesnt even have these methods, i dont think it will ever work either

    in java, everything is categorised.. all the gui stuff goes in one package, all the io in another.. given that volume is an audio related thing (bear in mind that some systems that java runs on do not have sound cards.. i.e. washing machines) you wont find it in the base system class

    i suggest you look through the JavaMedia Framework (JMF) tutorials
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  3. #3
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Operating system volume control

    Quote Originally Posted by alhajm
    I want to write a code that controls the operating system sound volume. The operating system which I am working with is Win XP pro.
    Java is designed to be platform independent, so it doesn't have OS-specific features like system volume control. The System class deals with the Java runtime environment, not the host operating system. However, the Java Sound API and the Java Media Framework (JMF) have loads of sound facilities that allow you to mess with sound in your programs.

    I tried to use:
    system.setVolume() and system.getVolume(). It does not work.
    There are no such methods in the System class. It's worth checking the API docs to see what methods are actually available in a class.

    The journey of a thousand miles starts with a single step...
    Chinese proverb
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured