How to enumerate, and select in C++ in the list of formats PCM published by a recording device in Windows 7?

I used the following to open a wave in the device (USB codec) under XP:

waveInOpen ((HWAVEIN*) & hWaveIn, idWaveIn, (LPWAVEFORMATEX) & wfx, MainDlg (DWORD)-> handle, 0, CALLBACK_WINDOW);

How could I do this in Windows 7?  The device is open with its default and no format approaches I tried to work.  Default format is listed in the applet sound like 1-channel, 16-bit, 44100 Hz (CD quality). What I need is listed as 2-channel, 16-bit, 32000 Hz (quality FM Radio).

Method 1:
the value input to the PCM format
PropVariantInit(&varConfigBuf);
HR = pProps-> GetValue (PKEY_AudioEngine_DeviceFormat & varConfigBuf);
If ((hr == S_OK) & (varConfigBuf.vt == VT_BLOB))
{
if(varConfigBuf.blob.cbSize>0)
{
WAVEFORMATEX * pWaveFormatExBlob = (WAVEFORMATEX *) (varConfigBuf.blob.pBlobData);
If (pWaveFormatExBlob-> nChannels! = wfx.nChannels |)
pWaveFormatExBlob-> nSamplesPerSec! = wfx.nSamplesPerSec)
{
WAVEFORMATEXTENSIBLE * pWaveFormatExtensibleBlob =(WAVEFORMATEXTENSIBLE*) pWaveFormatExBlob;

pWaveFormatExBlob-> wFormatTag = WAVE_FORMAT_EXTENSIBLE;
pWaveFormatExBlob-> nChannels = wfx.nChannels;
pWaveFormatExBlob-> nSamplesPerSec = wfx.nSamplesPerSec;
pWaveFormatExBlob-> wBitsPerSample = wfx.wBitsPerSample;
pWaveFormatExBlob-> which nBlockAlign = wfx.nBlockAlign;//pWaveFormatExBlob-> nChannels * pWaveFormatExBlob-> wBitsPerSample/8;
pWaveFormatExBlob-> wfx.nAvgBytesPerSec;//pWaveFormatExBlob-> nSamplesPerSec = nAvgBytesPerSec * pWaveFormatExBlob-> which nBlockAlign;
pWaveFormatExtensibleBlob-> Samples.wValidBitsPerSample = pWaveFormatExBlob-> wBitsPerSample;
pWaveFormatExtensibleBlob-> dwChannelMask = 3;
GUID sf = (GUID) pWaveFormatExtensibleBlob-> sous-format;
pWaveFormatExtensibleBlob-> sous-format = KSDATAFORMAT_SUBTYPE_PCM;

HR = pProps-> SetValue (PKEY_AudioEngine_DeviceFormat, varConfigBuf);
if(hr == S_OK)
{
HR = pProps-> Commit();
}
on the other
{
ShowMessage (AudioError (hr));
}
}

This method adds a new entry (2 channels, 16-bit, 32000 Hz) to the list of formats under the Advanced tab, but the camera is still recording mono.

Method 2:
IAudioClient * pAudioInterface = NULL;
HR = pEndpoint-> Activate (__uuidof (IAudioClient), CLSCTX_ALL,(void**) & pAudioInterface);

WAVEFORMATEX * pDeviceFormat;
HR = pAudioInterface-> () IsFormatSupported
AUDCLNT_SHAREMODE_EXCLUSIVE,
AUDCLNT_SHAREMODE_SHARED,
& wfx,
& pDeviceFormat
);
CoTaskMemFree (pDeviceFormat);

HR = pAudioInterface-> Initialize (AUDCLNT_SHAREMODE_EXCLUSIVE, 0, 5000000, 0, & wfx, NULL);
SAFE_RELEASE (pAudioInterface)

Initialize() returns 0, but no changes to the format of the device.

Is it possible to enumerate the list of formats provided by the sound applet, and then select one of the people I know is supported by the device?  It's probably pretty clear from the above, but in case not, I am scratching around the dark here and any help is appreciated (even with disparaging remarks included!).

Thank you
Piet

Hi Piet,

The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums for assistance:

Windows WDK Hardware and driver development-MSDN Forums

Tags: Windows

Similar Questions

  • How to join tables and get ppl not in the list of the other table

    Hi, I have 2 tables

    Table (girlscoutid, quarter, point)

    Table b (girlscoutid, fname lname)

    I want to get the names of ppl who didn't sell any point/s for Q4

    girlscoutid agenda quarter
    7771drinks4QS
    9000Tickets4QW
    7771Cookies2QS
    5085books3QF
    3010Tickets3QW
    5085Cookies1QF

    lscoutid fname lname
    7771JennRichochet
    9000LauraWilkins
    5085SallyMae
    3010DoraMcKenzie

    That's what I have, however, I get duplicates and also 7771 appears on the list even if she sold something on the 4th quarter. Any suggestions?

    SELECT fname, lname, a.girlscoutid

    Of a, b

    WHERE a.girlscoutid = b.girlscoutid

    AND the term NOT AS "4Q_";

    Hello

    So, all the information that you want to see figure in table b, but if you want to see it depends on the table has.

    This looks like a job for a semi Join.  Here's a way to do it:

    SELECT b.fname

    b.lname

    b.girlscoutid

    B

    LEFT OUTER JOIN has IT a.girlscoutid = b.girlscoutid

    AND a.quarter NOT AS "4Q_" - or a.TERM, if it is the column

    WHERE a.girscoutid IS NULL

    ;

    What you posted was an INNER join, where the rows of each table are included in the only game that if they have a corresponding row in the other table.

    An OUTER join includes all the rows in a table (table b in this case) if they have a match in the other table.  If a line of b has no corresponding row in a, then all the columns that are supposed to come from table will be NULL in the result set.  Given that the join condition includes = b.girlscoutid a.girlscoutid, this means that the only way to a.girlscoutid can be NULL in the result set is if the b line is included although it has no corresponding line one, which are exactly the lines that we want to display.  (You can try to run the query above with the WHERE clause, deleted, just to see how it works.)

    Alternatively, you can get the desired results by using a subquery NOT EXISTS, a NOT IN subquery or analytical functions.  The semi join, supra, is probably the most effective solution.

  • How do I know how is Administrator and where should I put the password to?

    My computer keeps asking for a password
    I have 3 standard users on my computer & no one is assigned to be administrator
    Cannot install updates because do not know or do not have a password
    How do I know how is Administrator and where should I put the password to?

    Hello

    The manual installation of the operating system on the Microsoft Update Web site updates requires the Office of the operating system to run with administrative rights.

    Please follow the steps mentioned below.

    a. click the Start button.

    (b) in the search box of start, type user accounts and click on user account.

    c. click on Manage.

    d. check which account is designated as administrator account.

    Also check out the links below.

    Why use a standard account instead of an administrator account?

    http://Windows.Microsoft.com/en-us/Windows-Vista/why-use-a-standard-user-account-instead-of-an-administrator-account

    What is an administrator account?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-an-administrator-account

    Change the type of user account

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-a-users-account-type

    Install Windows updates

    http://Windows.Microsoft.com/en-us/Windows-Vista/install-Windows-updates

    Updates: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows-Vista/updates-frequently-asked-questions

  • How to enable and disable, copy or rename the rules via the groovy script?

    A client, we received this question:

    How to enable and disable, copy or rename the rules via the groovy script?

    Foglight 5.7.5

    Hello

    There is this example of support KB

    support.Software.Dell.com/.../99059

    and there is also documentation of Service layer of the administration on the RuleService console.

    Best regards

    Golan

  • Hello. Please add 'select lowest layer' and 'select top layer' to the menu!

    Hello. Please add 'select lowest layer' and 'select top layer' to the menu!

    Replace.   to select the top layer (Option on Mac)

    and

    ALT to select bottom layer

  • How can I get a new category in the list?

    I have included a number of events of the churches, using the calendar in Thunderbird, but whenever I have to add 'Church' as a new category, even if I already added. How can I get a new category in the list? It might also be useful to be able to get rid of the categories that I'm probably not want. Is this possible?

    When you add the new category?
    If added to the event entry so it is an addition of time.
    You go to Options-calendar-categories and add is there to be a permanent choice. There is also a button to delete it.

  • How to display in RV320 / RV325 mgmt UI the list of ports opened by the application/device through UPNP?

    Hello

    Is it possible to display the list of open ports by using UPNP applications/devices?  In RV042, there is a 'UPnP Forwarding Table list' which is updated when a query or a device opened a port via UPNP.

    I can't seem to find the equivalent in RV320 / RV325.   Pls advise.

    Kind regards

    Albert

    Thanks for the info, I thought I was on my own without service contract: D.

    The function i and the OP was eager to already existed in the latest firmware, look under the menu Setup-online Port Address Translation-online UPnP Port Forwarding Table.

  • I'm doing my digitized and searchable PDF file using the PDF/a format Acrobat Pro XI... visiting version 8 of Acrobat there is an option available for simultaneous use to make available with OCR, but here in XI'AN, I am unable to do

    I'm doing my scanned PDF file and searchable using which makes the PDF/A format in Acrobat Pro XI in version 8 of Acrobat, there is an option available for use to make available with OCR, but here in XI'AN, I am unable to do it at the same time... Please help me to find the same.

    XI of Acrobat Pro, you can use the wizard for this Action.

  • How to upgrade a selection one line of the table based on values in another table when there is exactly one matching entry and negligence if there is more than a football game

    Hello

    I'm trying to achieve the following objectives:

    1. in table A, select rows based on the values in column 2. something like SELECT * FROM TABLE A WHERE (COLUMN2 = 'X' or Column2 IS NULL)

    2 and these values selected, I want to update Column3 from Table A if TableA.column1 = TableB.column1, but only if there is exactly one game. If there are multiple matches, column 3 of the table article updated.

    That's what I've tried so far.

    UPDATE TABLE_A

    SET

    TABLE_A.COLUMN3 = (SELECT COLUMN3 OF TABLE_B

    WHERE ((TABLE_B.COLUMN1 = TABLE_A.COLUMN1) AND ( TABLE_B.COLUMN1 IN (SELECT Column1 FROM TABLE_B GROUP BY COLUMN1 , HAVING COUNT (*) = 1)))

    WHERE EXISTS (SELECT * FROM TABLE_A)

    WHERE ((TABLE_A.COLUMN2 = 'X' OU TABLE_A.COLUMN2 = 'Y') AND (TABLE_A.COLUMN4 IS NULL OR TABLE_A.COLUMN4 = ' ')));

    More details on my DB environment:

    Version Info:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    Toad, but, depending on whether the query updated all lines. I would really appreciate if someone could tell me how to fix my request.

    Thanks in advance.

    Exists it predicate in the block of update will be set to true if there is at least one row in table_a where column2 is X or Y and column4 is null or a space. You need to correlate exists it with the outer query query (I'm guessing on column1) to get the result I think you want.  However, who would update all rows in table_a who meets the criteria, there is a corresponding row in table_b, affecting Column3 lines form null not matched or not.  (Again), I'm guessing that's not your intention.  If you only want to update the lines in table_a which have a corresponding line in table_b and meet the other predicate, then I think you want something more like:

    Update table_a

    Set table_a.column3 = (select column3 of table_b

    where table_b.column1 = table_a.column1 and

    Table_B.Column1 in (select column1 from table_b

    Group by column1, having count (*) = 1))

    where ((table_a.column2 = 'X' ou))

    table_a.Column2 = 'Y') and

    (table_a.column4 is null or)

    table_a.column4 = ' ')) and

    table_a.Column1 in (select column1 from table_b

    Group by column1, having count (*) = 1)

    John

  • How to hide and show based button if the line is selected in a table

    Hello

    IM pretty new to apex. I use version 4.1. I have a tabular form and I want to do is only have the button Show delete if I select a row in the column [line selector]. Is this possible using a dynamic action? I tried this way without success. Please help or let me know if you need more information.

    Thank you

    Do you mean if the box is checked in the line?

    Assign a static ID for the button Delete, for example MY_DEL_BTN. Search for 'Static ID' in the attributes of the button section.

    If so, do an advanced Click-based dynamic Action and a jQuery selector. Generally, this element is the name "f01" but, sure. Assuming that it is "f01" then your jquery selector would be:

    input[name="f01"]
    

    define the scope of the event live.

    Your dynamic action will trigger JavaScript. (BE SURE TO DESELECT FIRE ON PAGE LOAD). To make sure that you have the jQuery selector right, initially just to put a pop-up message in the JavaScript.

    alert('You Clicked the Row Selector!');
    

    Run the page. Click on the line selector. If you get the noise until you have specified the jQuery selector correctly. Yay!

    Then, assuming the above is correct. You can now determine if all have been selected.

    Now, set it to SELECT FIRE on PAGE LOAD (you want deleting DialogResult.Cancel when you open the page).

    Change your JavaScript like this:

    var checkedCnt = $("input:checked").length;
    
    if( checkedCnt > 0 )
    {
       $('#MY_DEL_BTN').show();
    }
    else
    {
       $('#MY_DEL_BTN').hide();
    };
    

    -Joe

  • For a given file, how to add and change file properties on the Details tab, for properties that are not in the properties list?

    Now, I am aware of the modification of the properties of the file is simple in Windows 7 Explorer. Select a file, 'Properties', then tab "Details".  Some are not editable, and that's understandable.  Click on next to any area classified as year, Genre, Publisher, etc. and the apply.  No problems so far.

    Then of course in Explorer, when you right click on a column header, you get several choices of column beyond the usual that is displayed by default; Date, the Type, size, etc.  But, there is an option "More...", which has up to now, MUCH more useful properties to choose from, such as the model project, Department, job statusand so on.

    It's fantastic!

    But when you look into the details of any given file, none of these additional properties even are listed to be edited.  Why offer to view these details, if you don't change them, or add them to different files?  I must be missing something.  I do not need to add my own custom details, this additional list has a choice, that I need; If only I could edit the files to get this info.

    How to add and change these properties to files?  Word, Excel, MP4, AVI, JPG; I would add these properties, so I can set directly in the Solution Explorer, as you would by name or Type.

    Any help would be greatly appreciated!

    My experience is that most of these 'extra fields' no existence not as fields in the directory (folder) itself.  On the contrary, these fields exist in the target file itself. Each file type has its own format and established file except for the types of files that belong to Microsoft, Microsoft cannot control or arbitrarily change the format of a particular file type.

    For example, a ".jpg" file  The format of this file type allows a large number of areas such as comments, Tags, date taken, opening, device manufacturer and so on.  If you go into the properties on a .jpg file, you will see a lot of them and will be able to change.  After changing any of these fields, you will find that the file itself has been changed to contain this information (as can be verified by the parity of the file and to come check upward with a different checksum).  If you display one of these fields in Explorer and 10000 ".jpg" files in this folder, then Explorer must open each of these 10000 files to extract the data in the corresponding fields, you have chosen to display.  May take some time.

    Compare that to the same picture saved to a file ".bmp".  The ".bmp" format has no provisions for any of these fields, so you will not be able to view, save, edit, or sort by them.  If the editable fields are directly related to the type of file that is displayed.

    Microsoft has apparently interviewed a lot of file types and made a compilation of the editable fields in each type of file and the Union of the selected fields in which can be displayed and modified.   That's apparently what you see in the option «More...» ».   So, in summary, the file type determines which fields are available for editing and posting.

    HTH,

    JW

  • I am from Bangladesh. And Bangladesh is not on the list of countries. How can I buy Photoshop from here?

    Hello

    I am from Bangladesh. I plan to buy photoshop and illustrator. But the name of my country (Bangladesh) not on the list. So how can I buy?

    If I select other countries is - illegal to use it in Bangladesh?

    You will need to get re seller getting Adobe Apps in Bangladesh.

    Please check:

    Home page | Tech Global One

    http://adobedealreg.force.com/PartnerSearch?lang=en

    http://shop.Daffodil-BD.com/index.php?route=product/category&path=17_116

    Please make sure that the seller re are certified by Adobe.

    Concerning

    Stéphane

  • I can't open the files I download from my Web site. I select a file in the list down and nothing happens

    I'm on a Web site, I ask the file loading, usually a report. the download occurs. I click on the button download and see the list of downloaded files. I chose one. NOTHING IS GETTING PAST. What did wrong and how fix?
    Thank you
    Joel Rehagen

    Hello

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your essential information such as bookmarks and history.
    Note: but it will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

    Thank you.

  • Outlook Express broke down. With XP SP3 can get detailed instructions on how to uninstall and reinstall Outlook Express with the original disc?

    Outlook Express broke down.  With Windows XP SP3 can get detailed instructions on how to uninstall and reinstall Outlook with original disc?

    OE gives an error message standard it is not correctly installed.  Its a remnant message from OE4 and is false.  You probably corruption with folders.dbx and you should remove it.  See www.oehelp.com/OETips.aspx#7 then, after departures OE you must back up your messages and given the corruption, go to file | Identities and setup a new identity for you give a fresh message store and then you can use file | Import | Messages to bring them from the old identity.

    Steve

  • How to load and you unsubscribe contacts of the group e-mail to the E10?

    I know how to load new contacts and worldwide unsubscribe them but I'm trying to figure out how to unsubscribe them only to the Group an email because we have several brands. Someone knows how to do this in E10? Thank you

    Hi Rebecca

    One way I've seen to do would be to put everyone in a list shared during the download.

    Then, build a small program that has a stage for them to unsubscribe from the campaign. Add the list shared in the program and this will be done.

Maybe you are looking for

  • Possibility to buy various iTunes stores

    Apple still not solved the unacceptable situation where various applications and media are available in say that the Bank of France but not the US store? For example, Michelin has a free app on the French store, but I can't get it as I have a U.S. Ra

  • S540 battery not detected in Windows 10

    Hi all Just upgraded to Windows 10, but I now discover that the new companion of Lenovo or Lenovo settings enforcement will not detect the battery. I installed the System Interface Foundation etc., but to no avail. Battery is being charged is more th

  • HP EliteBook 8770W I7 - 3520M 2.9 GHZ

    I just buy above laptop for work, but already to load Win 10 Pro, but I need to go back to the pre-installed Win 7 Pro, but I don't have the recovery CD. What can I do on this case? Best, P

  • My computer freezes and gets the blue screen at least three times a day. I cannot understand why, and I'm frustrated. Help, please!

    My computer makes sure to plant three to five times a day. It always ends with the blue screen of death and strong buzz. I think it's perhaps because of Spotify, but I've updated, reloaded and all and yet the program itself and my computer still seem

  • Change of mobile phone of my hotmail account number

    Hello Recently, my account has been hacked and I asked how to recover my account to support. Due to the very end processing time, I tried it myself and finally managed to get my account after a stressful period. It was difficult for me that my accoun