How to play a simple audio with WIn32 API in C++

thebluetropics 1,046 Reputation points
2022-09-19T09:55:08.043+00:00

I have read the Win32 documentation in Graphics and Multimedia section, Core Audio Programming Guide.

There is no simple example to load mp3 file and play it using Win32 API in the documentation, as always.

In short, I am looking for a simplest approach for loading an mp3 file and play the sound using Win32 API.

If possible, I need to do pause, track the progress, stop, skip or back at specified position.

Note: Simple here doesn't mean easy, it can be a complex thing, on the most basic level.

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,585 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,689 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 84,471 Reputation points
    2022-09-19T10:07:17.903+00:00

    One of the simplest ways is with MCI, like mciSendString

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Guido Franzke 2,196 Reputation points
    2022-09-19T10:12:13.237+00:00

    Hello,
    have a look at this: simplest-way-to-play-mp3-from-visual-c
    Regards, Guido

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.