This is a project with C++ to create a command line integrated music player using MciSendStrings
Sample Screenshots
Introduction:
The Project to be developed is a Command Line Based Music Player completely written in C++. It should play, pause and shuffle all music files in a specific directory and all it’s interface should be in C++ command line terminal. We have divided the code into three files namely files.h , define.h , and main.cpp so as to improve code readability and debugging.
Objective:
The main objective is to play any non variable bit rate mp3 file using mciSendStrings() function defined in C++ windows.h header file.
Instructions
-
To run this code in visual studio code you have to add linker library -lwinmm It's a Windows Multimedia Library
-
If you are using code blocks or Visual Studio IDE you can directly add path of lwinmm in linker library options.
-
If you want to add more songs you can add it in songs folder after converting mp3 files to mono bitrate.
Working Environment:
- Visual Studio Code - 1.56.2
- C++ standard 17
- Operating System – Windows 10 64 Bit
- C++ Compiler – MinGW gcc x64
References
- CodeProject - https://www.codeproject.com/Articles/14709/Playing-MP3s-using-MCI
- Stackoverflow - https://stackoverflow.com/questions/22253074/how-to-play-or-open-mp3-or-wav-sound-file-in-c-program
- Codespeedy - https://www.codespeedy.com/play-a-part-of-an-mp3-file-in-cpp/
- Github - microsoft/vscode-cpptools#6191