mmioOpen function is deprecated, advised is to use CreateFile. How to continue with other mmio functions?

Tony 96 Reputation points
2023-03-13T22:06:43.52+00:00

Hello,

When I use mmioOpen, all other mmio methods are working fine on Win 11 latest update.

However mmioOpen is deprecated and I should use CreateFile or CreateFile2 instead that's what the documentation says (https://learn.microsoft.com/en-us/windows/win32/api/mmiscapi/nf-mmiscapi-mmioopen) .

My issue is that creating a wav file by method CreateFile, all other mmio methods like mmioAscend return code 263 (MMIOERR_CANNOTSEEK). What is the proper way to use CreateFile or CreateFile2 to work correctly with mmio?

The code I use is posted here by Rita Han (https://stackoverflow.com/questions/64318206/record-an-audio-stream-with-wasapi)

Thank you.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,523 questions
{count} vote

Accepted answer
  1. Castorix31 83,206 Reputation points
    2023-03-15T17:47:36.2366667+00:00

    mmioOpen function is deprecated

    It is not deprecated

    It is a bug in documentation

    You would need a lot of code to replace all what mmioOpen does...

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Xiaopo Yang - MSFT 12,231 Reputation points Microsoft Vendor
    2023-03-14T02:37:23.2333333+00:00

    Hello

    You can refer to the CaptureSharedEventDriven sample, which also Write the captured wave data to an output file using CreateFile and WriteFile or the ApplicationLoopback sample.

    And note that the CaptureSharedEventDriven sample has a flaw after resuming from a breakpoint.