473,517 Members | 2,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to decrease audio level

I wrote an application and I want to decrease "system's" audio level .I dont
want to do it via directshow must do it on directly window's wave volume
control.
Thankse
Nov 16 '05 #1
3 5118
b wrote:
I wrote an application and I want to decrease "system's" audio level .I dont
want to do it via directshow must do it on directly window's wave volume
control.


Hi b,

a better variant of the code originally posted by ar***@caramail.com:

using System;
using System.Runtime.InteropServices;

public class AudioMixerHelper
{
public const int MMSYSERR_NOERROR = 0;
public const int MAXPNAMELEN = 32;
public const int MIXER_LONG_NAME_CHARS = 64;
public const int MIXER_SHORT_NAME_CHARS = 16;
public const int MIXER_GETLINEINFOF_COMPONENTTYPE = 0x3;
public const int MIXER_GETCONTROLDETAILSF_VALUE = 0x0;
public const int MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x2;
public const int MIXER_SETCONTROLDETAILSF_VALUE = 0x0;
public const int MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x0;
public const int MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x1000;
public const int MIXERLINE_COMPONENTTYPE_DST_SPEAKERS =
(MIXERLINE_COMPONENTTYPE_DST_FIRST + 4);
public const int MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE =
(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3);
public const int MIXERLINE_COMPONENTTYPE_SRC_LINE =
(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2);
public const int MIXERCONTROL_CT_CLASS_FADER = 0x50000000;
public const int MIXERCONTROL_CT_UNITS_UNSIGNED = 0x30000;
public const int MIXERCONTROL_CONTROLTYPE_FADER =
(MIXERCONTROL_CT_CLASS_FADER | MIXERCONTROL_CT_UNITS_UNSIGNED);
public const int MIXERCONTROL_CONTROLTYPE_VOLUME =
(MIXERCONTROL_CONTROLTYPE_FADER + 1);

[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerClose (int hmx);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetControlDetailsA (int hmxobj,ref
MIXERCONTROLDETAILS pmxcd , int fdwDetails);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetDevCapsA(int uMxId, MIXERCAPS
pmxcaps, int cbmxcaps);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetID (int hmxobj, int pumxID, int
fdwId);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetLineControlsA (int hmxobj,ref
MIXERLINECONTROLS pmxlc, int fdwControls);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetLineInfoA (int hmxobj,ref
MIXERLINE pmxl , int fdwInfo);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetNumDevs();
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerMessage(int hmx , int uMsg , int
dwParam1 , int dwParam2);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerOpen (out int phmx , int uMxId ,
int dwCallback , int dwInstance , int fdwOpen);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerSetControlDetails(int hmxobj ,ref
MIXERCONTROLDETAILS pmxcd , int fdwDetails);

public struct MIXERCAPS
{
public int wMid;
public int wPid;
public int vDriverVersion;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAXPNAMELEN)]
public string szPname;
public int fdwSupport;
public int cDestinations;
}

public struct MIXERCONTROL
{
public int cbStruct;
public int dwControlID;
public int dwControlType;
public int fdwControl;
public int cMultipleItems;
[MarshalAs( UnmanagedType.ByValTStr,
SizeConst=MIXER_SHORT_NAME_CHARS)]
public string szShortName ;
[MarshalAs( UnmanagedType.ByValTStr,
SizeConst=MIXER_LONG_NAME_CHARS)]
public string szName;
public int lMinimum;
public int lMaximum;
[MarshalAs(UnmanagedType.U4, SizeConst=10)]
public int reserved;
}

public struct MIXERCONTROLDETAILS
{
public int cbStruct;
public int dwControlID;
public int cChannels;
public int item;
public int cbDetails;
public IntPtr paDetails;
}

public struct MIXERCONTROLDETAILS_UNSIGNED
{
public int dwValue;
}

public struct MIXERLINE
{
public int cbStruct;
public int dwDestination;
public int dwSource;
public int dwLineID;
public int fdwLine;
public int dwUser;
public int dwComponentType;
public int cChannels;
public int cConnections;
public int cControls;
[MarshalAs(UnmanagedType.ByValTStr,
SizeConst=MIXER_SHORT_NAME_CHARS)]
public string szShortName;
[MarshalAs(UnmanagedType.ByValTStr,
SizeConst=MIXER_LONG_NAME_CHARS )]
public string szName;
public int dwType;
public int dwDeviceID;
public int wMid;
public int wPid;
public int vDriverVersion ;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAXPNAMELEN)]
public string szPname ;
}

public struct MIXERLINECONTROLS
{
public int cbStruct;
public int dwLineID;

public int dwControl;
public int cControls;
public int cbmxctrl;
public IntPtr pamxctrl;
}

private static bool GetVolumeControl(int hmixer, int componentType,
int ctrlType, out MIXERCONTROL mxc, out int vCurrentVol)
{
// This function attempts to obtain a mixer control.
// Returns True if successful.
MIXERLINECONTROLS mxlc = new MIXERLINECONTROLS();
MIXERLINE mxl = new MIXERLINE();
MIXERCONTROLDETAILS pmxcd = new MIXERCONTROLDETAILS();
MIXERCONTROLDETAILS_UNSIGNED du = new
MIXERCONTROLDETAILS_UNSIGNED();
mxc = new MIXERCONTROL();
int rc;
bool retValue;
vCurrentVol = -1;

mxl.cbStruct = Marshal.SizeOf(mxl);
mxl.dwComponentType = componentType;

rc = mixerGetLineInfoA(hmixer,ref mxl,
MIXER_GETLINEINFOF_COMPONENTTYPE );

if(MMSYSERR_NOERROR == rc)
{
int sizeofMIXERCONTROL = 152;
int ctrl = Marshal.SizeOf(typeof(MIXERCONTROL));
mxlc.pamxctrl = Marshal.AllocCoTaskMem(sizeofMIXERCONTROL);
mxlc.cbStruct = Marshal.SizeOf(mxlc);
mxlc.dwLineID = mxl.dwLineID;
mxlc.dwControl = ctrlType;
mxlc.cControls = 1;
mxlc.cbmxctrl = sizeofMIXERCONTROL;

// Allocate a buffer for the control
mxc.cbStruct = sizeofMIXERCONTROL;

// Get the control
rc = mixerGetLineControlsA(hmixer,ref mxlc,
MIXER_GETLINECONTROLSF_ONEBYTYPE);

if(MMSYSERR_NOERROR == rc)
{
retValue = true;

// Copy the control into the destination structure
mxc = (MIXERCONTROL)Marshal.PtrToStructure(
mxlc.pamxctrl,typeof(MIXERCONTROL));
}
else
{
retValue = false;
}
int sizeofMIXERCONTROLDETAILS =
Marshal.SizeOf(typeof(MIXERCONTROLDETAILS));
int sizeofMIXERCONTROLDETAILS_UNSIGNED =
Marshal.SizeOf(typeof(MIXERCONTROLDETAILS_UNSIGNED ));
pmxcd.cbStruct = sizeofMIXERCONTROLDETAILS;
pmxcd.dwControlID = mxc.dwControlID;
pmxcd.paDetails =

Marshal.AllocCoTaskMem(sizeofMIXERCONTROLDETAILS_U NSIGNED) ;
pmxcd.cChannels = 1;
pmxcd.item = 0;
pmxcd.cbDetails = sizeofMIXERCONTROLDETAILS_UNSIGNED;

rc = mixerGetControlDetailsA(hmixer,ref pmxcd,
MIXER_GETCONTROLDETAILSF_VALUE);

du = (MIXERCONTROLDETAILS_UNSIGNED)Marshal.PtrToStructu re(
pmxcd.paDetails, typeof(MIXERCONTROLDETAILS_UNSIGNED));

vCurrentVol = du.dwValue;

return retValue;
}

retValue = false;
return retValue;
}

private static bool SetVolumeControl(int hmixer, MIXERCONTROL mxc,
int volume)
{
// This function sets the value for a volume control.
// Returns True if successful

bool retValue;
int rc;
MIXERCONTROLDETAILS mxcd = new MIXERCONTROLDETAILS();
MIXERCONTROLDETAILS_UNSIGNED vol = new
MIXERCONTROLDETAILS_UNSIGNED();

mxcd.item = 0;
mxcd.dwControlID = mxc.dwControlID;
mxcd.cbStruct = Marshal.SizeOf(mxcd);
mxcd.cbDetails = Marshal.SizeOf(vol);

// Allocate a buffer for the control value buffer
mxcd.cChannels = 1;
vol.dwValue = volume;

// Copy the data into the control value buffer
mxcd.paDetails = Marshal.AllocCoTaskMem(Marshal.SizeOf(
typeof(MIXERCONTROLDETAILS_UNSIGNED)));
Marshal.StructureToPtr(vol, mxcd.paDetails,false);

// Set the control value
rc = mixerSetControlDetails(hmixer,ref mxcd,
MIXER_SETCONTROLDETAILSF_VALUE);

if(MMSYSERR_NOERROR == rc)
{
retValue = true;
}
else
{
retValue = false;
} return retValue;
}

public static int GetVolume()
{
int mixer;
MIXERCONTROL volCtrl = new MIXERCONTROL();
int currentVol;
mixerOpen(out mixer,0 ,0 ,0, 0);
int type = MIXERCONTROL_CONTROLTYPE_VOLUME;
GetVolumeControl(mixer,
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,type,out volCtrl, out
currentVol);
mixerClose(mixer);

return currentVol;
}

public static void SetVolume(int vVolume)
{
int mixer;
MIXERCONTROL volCtrl = new MIXERCONTROL();
int currentVol;
mixerOpen(out mixer,0 ,0 ,0, 0);
int type = MIXERCONTROL_CONTROLTYPE_VOLUME;
GetVolumeControl(mixer,
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,type,out volCtrl, out
currentVol);
if(vVolume > volCtrl.lMaximum) vVolume = volCtrl.lMaximum;
if(vVolume < volCtrl.lMinimum) vVolume = volCtrl.lMinimum;
SetVolumeControl(mixer, volCtrl, vVolume);
GetVolumeControl(mixer,
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,type,out volCtrl, out
currentVol);
if(vVolume != currentVol)
{
throw new Exception("Cannot Set Volume");
}
mixerClose(mixer);
}
}
Usage:

private void button1_Click(object sender, System.EventArgs e)
{
//Display the current master volume
MessageBox.Show(AudioMixerHelper.GetVolume().ToStr ing());
//set the master volume
AudioMixerHelper.SetVolume(1000);
//Display the new volume
MessageBox.Show(AudioMixerHelper.GetVolume().ToStr ing());
}

Cheers

Arne Janning
Nov 16 '05 #2
Thank you for that code, you have just saved me a lot of time figuring it
out for myself.
I was about to ask about using the mixer controls... You must be psychic
!!! lol
--
===============================
try
{
Linux (any version)
}
catch
{
Format (mainHardDisk)
Install (Windows2000/XP/2003)
}
// You know you want to !!!

John Young
"Arne Janning" <sp*****************@msn.com> wrote in message
news:Oy**************@TK2MSFTNGP11.phx.gbl...
b wrote:
I wrote an application and I want to decrease "system's" audio level .I
dont
want to do it via directshow must do it on directly window's wave volume
control.


Hi b,

a better variant of the code originally posted by ar***@caramail.com:

using System;
using System.Runtime.InteropServices;

public class AudioMixerHelper
{
public const int MMSYSERR_NOERROR = 0;
public const int MAXPNAMELEN = 32;
public const int MIXER_LONG_NAME_CHARS = 64;
public const int MIXER_SHORT_NAME_CHARS = 16;
public const int MIXER_GETLINEINFOF_COMPONENTTYPE = 0x3;
public const int MIXER_GETCONTROLDETAILSF_VALUE = 0x0;
public const int MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x2;
public const int MIXER_SETCONTROLDETAILSF_VALUE = 0x0;
public const int MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x0;
public const int MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x1000;
public const int MIXERLINE_COMPONENTTYPE_DST_SPEAKERS =
(MIXERLINE_COMPONENTTYPE_DST_FIRST + 4);
public const int MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE =
(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3);
public const int MIXERLINE_COMPONENTTYPE_SRC_LINE =
(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2);
public const int MIXERCONTROL_CT_CLASS_FADER = 0x50000000;
public const int MIXERCONTROL_CT_UNITS_UNSIGNED = 0x30000;
public const int MIXERCONTROL_CONTROLTYPE_FADER =
(MIXERCONTROL_CT_CLASS_FADER | MIXERCONTROL_CT_UNITS_UNSIGNED);
public const int MIXERCONTROL_CONTROLTYPE_VOLUME =
(MIXERCONTROL_CONTROLTYPE_FADER + 1);

[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerClose (int hmx);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetControlDetailsA (int hmxobj,ref
MIXERCONTROLDETAILS pmxcd , int fdwDetails);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetDevCapsA(int uMxId, MIXERCAPS
pmxcaps, int cbmxcaps);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetID (int hmxobj, int pumxID, int
fdwId);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetLineControlsA (int hmxobj,ref
MIXERLINECONTROLS pmxlc, int fdwControls);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetLineInfoA (int hmxobj,ref
MIXERLINE pmxl , int fdwInfo);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerGetNumDevs();
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerMessage(int hmx , int uMsg , int
dwParam1 , int dwParam2);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerOpen (out int phmx , int uMxId ,
int dwCallback , int dwInstance , int fdwOpen);
[DllImport("winmm.dll", CharSet=CharSet.Ansi)]
private static extern int mixerSetControlDetails(int hmxobj ,ref
MIXERCONTROLDETAILS pmxcd , int fdwDetails);

public struct MIXERCAPS
{
public int wMid;
public int wPid;
public int vDriverVersion;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAXPNAMELEN)]
public string szPname;
public int fdwSupport;
public int cDestinations;
}

public struct MIXERCONTROL
{
public int cbStruct;
public int dwControlID;
public int dwControlType;
public int fdwControl;
public int cMultipleItems;
[MarshalAs( UnmanagedType.ByValTStr,
SizeConst=MIXER_SHORT_NAME_CHARS)]
public string szShortName ;
[MarshalAs( UnmanagedType.ByValTStr,
SizeConst=MIXER_LONG_NAME_CHARS)]
public string szName;
public int lMinimum;
public int lMaximum;
[MarshalAs(UnmanagedType.U4, SizeConst=10)]
public int reserved;
}

public struct MIXERCONTROLDETAILS
{
public int cbStruct;
public int dwControlID;
public int cChannels;
public int item;
public int cbDetails;
public IntPtr paDetails;
}

public struct MIXERCONTROLDETAILS_UNSIGNED
{
public int dwValue;
}

public struct MIXERLINE
{
public int cbStruct;
public int dwDestination;
public int dwSource;
public int dwLineID;
public int fdwLine;
public int dwUser;
public int dwComponentType;
public int cChannels;
public int cConnections;
public int cControls;
[MarshalAs(UnmanagedType.ByValTStr,
SizeConst=MIXER_SHORT_NAME_CHARS)]
public string szShortName;
[MarshalAs(UnmanagedType.ByValTStr,
SizeConst=MIXER_LONG_NAME_CHARS )]
public string szName;
public int dwType;
public int dwDeviceID;
public int wMid;
public int wPid;
public int vDriverVersion ;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAXPNAMELEN)]
public string szPname ;
}

public struct MIXERLINECONTROLS
{
public int cbStruct;
public int dwLineID;

public int dwControl;
public int cControls;
public int cbmxctrl;
public IntPtr pamxctrl;
}

private static bool GetVolumeControl(int hmixer, int componentType,
int ctrlType, out MIXERCONTROL mxc, out int vCurrentVol)
{
// This function attempts to obtain a mixer control.
// Returns True if successful.
MIXERLINECONTROLS mxlc = new MIXERLINECONTROLS();
MIXERLINE mxl = new MIXERLINE();
MIXERCONTROLDETAILS pmxcd = new MIXERCONTROLDETAILS();
MIXERCONTROLDETAILS_UNSIGNED du = new
MIXERCONTROLDETAILS_UNSIGNED();
mxc = new MIXERCONTROL();
int rc;
bool retValue;
vCurrentVol = -1;

mxl.cbStruct = Marshal.SizeOf(mxl);
mxl.dwComponentType = componentType;

rc = mixerGetLineInfoA(hmixer,ref mxl,
MIXER_GETLINEINFOF_COMPONENTTYPE );

if(MMSYSERR_NOERROR == rc)
{
int sizeofMIXERCONTROL = 152;
int ctrl = Marshal.SizeOf(typeof(MIXERCONTROL));
mxlc.pamxctrl = Marshal.AllocCoTaskMem(sizeofMIXERCONTROL);
mxlc.cbStruct = Marshal.SizeOf(mxlc);
mxlc.dwLineID = mxl.dwLineID;
mxlc.dwControl = ctrlType;
mxlc.cControls = 1;
mxlc.cbmxctrl = sizeofMIXERCONTROL;

// Allocate a buffer for the control
mxc.cbStruct = sizeofMIXERCONTROL;

// Get the control
rc = mixerGetLineControlsA(hmixer,ref mxlc,
MIXER_GETLINECONTROLSF_ONEBYTYPE);

if(MMSYSERR_NOERROR == rc)
{
retValue = true;

// Copy the control into the destination structure
mxc = (MIXERCONTROL)Marshal.PtrToStructure(
mxlc.pamxctrl,typeof(MIXERCONTROL));
}
else
{
retValue = false;
}
int sizeofMIXERCONTROLDETAILS =
Marshal.SizeOf(typeof(MIXERCONTROLDETAILS));
int sizeofMIXERCONTROLDETAILS_UNSIGNED =
Marshal.SizeOf(typeof(MIXERCONTROLDETAILS_UNSIGNED ));
pmxcd.cbStruct = sizeofMIXERCONTROLDETAILS;
pmxcd.dwControlID = mxc.dwControlID;
pmxcd.paDetails =

Marshal.AllocCoTaskMem(sizeofMIXERCONTROLDETAILS_U NSIGNED) ;
pmxcd.cChannels = 1;
pmxcd.item = 0;
pmxcd.cbDetails = sizeofMIXERCONTROLDETAILS_UNSIGNED;

rc = mixerGetControlDetailsA(hmixer,ref pmxcd,
MIXER_GETCONTROLDETAILSF_VALUE);

du = (MIXERCONTROLDETAILS_UNSIGNED)Marshal.PtrToStructu re(
pmxcd.paDetails, typeof(MIXERCONTROLDETAILS_UNSIGNED));

vCurrentVol = du.dwValue;

return retValue;
}

retValue = false;
return retValue;
}

private static bool SetVolumeControl(int hmixer, MIXERCONTROL mxc,
int volume)
{
// This function sets the value for a volume control.
// Returns True if successful

bool retValue;
int rc;
MIXERCONTROLDETAILS mxcd = new MIXERCONTROLDETAILS();
MIXERCONTROLDETAILS_UNSIGNED vol = new
MIXERCONTROLDETAILS_UNSIGNED();

mxcd.item = 0;
mxcd.dwControlID = mxc.dwControlID;
mxcd.cbStruct = Marshal.SizeOf(mxcd);
mxcd.cbDetails = Marshal.SizeOf(vol);

// Allocate a buffer for the control value buffer
mxcd.cChannels = 1;
vol.dwValue = volume;

// Copy the data into the control value buffer
mxcd.paDetails = Marshal.AllocCoTaskMem(Marshal.SizeOf(
typeof(MIXERCONTROLDETAILS_UNSIGNED)));
Marshal.StructureToPtr(vol, mxcd.paDetails,false);

// Set the control value
rc = mixerSetControlDetails(hmixer,ref mxcd,
MIXER_SETCONTROLDETAILSF_VALUE);

if(MMSYSERR_NOERROR == rc)
{
retValue = true;
}
else
{
retValue = false;
} return retValue;
}

public static int GetVolume()
{
int mixer;
MIXERCONTROL volCtrl = new MIXERCONTROL();
int currentVol;
mixerOpen(out mixer,0 ,0 ,0, 0);
int type = MIXERCONTROL_CONTROLTYPE_VOLUME;
GetVolumeControl(mixer,
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,type,out volCtrl, out
currentVol);
mixerClose(mixer);

return currentVol;
}

public static void SetVolume(int vVolume)
{
int mixer;
MIXERCONTROL volCtrl = new MIXERCONTROL();
int currentVol;
mixerOpen(out mixer,0 ,0 ,0, 0);
int type = MIXERCONTROL_CONTROLTYPE_VOLUME;
GetVolumeControl(mixer,
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,type,out volCtrl, out
currentVol);
if(vVolume > volCtrl.lMaximum) vVolume = volCtrl.lMaximum;
if(vVolume < volCtrl.lMinimum) vVolume = volCtrl.lMinimum;
SetVolumeControl(mixer, volCtrl, vVolume);
GetVolumeControl(mixer,
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,type,out volCtrl, out
currentVol);
if(vVolume != currentVol)
{
throw new Exception("Cannot Set Volume");
}
mixerClose(mixer);
}
}
Usage:

private void button1_Click(object sender, System.EventArgs e)
{
//Display the current master volume
MessageBox.Show(AudioMixerHelper.GetVolume().ToStr ing());
//set the master volume
AudioMixerHelper.SetVolume(1000);
//Display the new volume
MessageBox.Show(AudioMixerHelper.GetVolume().ToStr ing());
}

Cheers

Arne Janning

Nov 16 '05 #3
thnx a lot
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2476
by: Kelvin Chu | last post by:
Hello, Python Wizards... I'm trying to use Python to write an aiff file. I've used the aifc module and I've set the parameters (# of channels, encoding rate, compression, etc.) What does raw audio data look like? Is each word of the raw audio data a frequency? If I encode 440 for each of the frames, will I get concert A? Thanks for...
22
3711
by: MLH | last post by:
I have some audio help files that play fine from within Access 97 and Access 2.0. Both are running on a Windows XP box. But I do not know what program plays the files. If I click Start, Run and type in c:\MyApp\MyHelp\Help1.wav, Windows Media Player tries unsuccessfully to play the wav file. It err's saying ClassFactory cannot supply the...
2
6412
by: .:.:. igor_sb .:.:. | last post by:
I would like to make Vu-meter (audio level meter). I found axControl for drawing audio level but now I have to capture audio... HOW?? Thanks! Igor
1
2973
by: juky | last post by:
Hi all, I have an audio device connected to my computer through line-in. At not regular base the device send audio signal to the line-in. Now, what I need to do is to write an application in VB.NET to monitor the line-in and in the presence of analog signal I have to call some other functions. How can detect it ? Any idea? Thanks, Juky
11
3749
by: jim shirreffs | last post by:
Hello, I am trying to put together a Java system for playing audio CDs on a large CD player, I have most of it working But entering all the data like Artist, Title, track name, track length (seconds) is a real pain in the butt. What I would like to do is write a java class that would extrack that info from an audio CD placed in the computers...
12
5884
by: baibaichen | last post by:
i know that pImpl idiom can decrease compile time, but Is there any good practice/idiom to decrease link time? any reference or any idea is appreciated thanks
2
2700
by: BarryX | last post by:
Hey, I am trying to write a section of code in VB that gives me the audio level of the output from a sound card. If I am using a Soundblaster this is very easy as I can use the MIXERCONTROL_CONTROLTYPE_PEAKMETER. But not all sound cards have this. I have seen some code which looks at the level on the input by checking samples and I can...
4
6256
by: hzgt9b | last post by:
Using VS 2003, VB.NET and/or ASP.NET 2.0, BACKGROUND I have a window forms based application that contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowser) control. The TreeView is populated with nodes that when clicked play an audio clip from specified local or web URL and navigate the browser control to a specified local or...
12
1735
by: Andrew Poulos | last post by:
I don't have IE 7 but is it true that IE 7 prevents javascript from playing audio without the user first responding positively to a dialog box? I have an elearning app that uses audio which is controlled by a simple player. I know it would annoy the client if the user had to click a 'play' button and then also click 'yes' in a dialog box. ...
0
7188
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7422
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7590
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7150
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5117
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1629
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.