I don't have any strong enough knowledge to build this kind of app, console-based. As far as I have info about how to build this kind of console-based app, it requires Windows Audio Internal API, if i am not mistaken, it's WASAPI. But since I don't have that knowledge at all, please help me to do this kind of app
What I have tried:
I was trying to do it with some AI tools, like chatgpt 3 and google gemini(google bard). But I couldn't figure out how to do it, though it gives some code snippets to build that kind of console-based app.
Here's what it's generated for me:
#include <windows.h>
#include <mmsystem.h>
#include <iostream>
bool isAudioPlaying() {
HWAVEOUT hWaveOut;
MMTIME mmTime;
if (waveOutOpen(&hWaveOut, WAVE_MAPPER, NULL, (DWORD_PTR) NULL, 0, CALLBACK_NULL)) {
std::cerr << "Error opening wave output device." << std::endl;
return false;
}
mmTime.wType = TIME_PLAY;
if (waveOutGetPosition(hWaveOut, &mmTime, sizeof(mmTime))) {
std::cerr << "Error getting playback position." << std::endl;
waveOutClose(hWaveOut);
return false;
}
waveOutClose(hWaveOut);
return (mmTime.wTime > 0);
}
int main() {
if (isAudioPlaying()) {
std::cout << "It does." << std::endl;
} else {
std::cout << "It doesn't." << std::endl;
}
return 0;
}
But it's not generating code for a specific audio file