germadas.blogg.se

Acid music studio 10 not opening mp3 file
Acid music studio 10 not opening mp3 file







acid music studio 10 not opening mp3 file

acid music studio 10 not opening mp3 file

PlaySound(buffer, GetModuleHandle(NULL), SND_MEMORY | SND_ASYNC | SND_LOOP) PlaySound(buffer, GetModuleHandle(NULL), SND_MEMORY | SND_ASYNC)

acid music studio 10 not opening mp3 file

Note that you must specify both the SND_ASYNC and SND_LOOP flags, because you never going to wait until a sound, that repeats itself countless times, is over!Īlso you can fopen the wave file and copy all it's bytes to a buffer (an enormous/huge (very big) array of bytes) with the fread function and then: PlaySound(buffer, GetModuleHandle(NULL), SND_MEMORY) SndPlaySound("*.wav", SND_FILENAME | SND_ASYNC | SND_LOOP) To play the wave file over and over again: PlaySound("*.wav", GetModuleHandle(NULL), SND_FILENAME | SND_ASYNC | SND_LOOP) SndPlaySound("*.wav", SND_FILENAME | SND_ASYNC)

acid music studio 10 not opening mp3 file

If you don't want to wait until the playback is over: PlaySound("*.wav", GetModuleHandle(NULL), SND_FILENAME | SND_ASYNC) If you don't want to specify an handle to a module: sndPlaySound("*.wav", SND_FILENAME) When you're done playing this *.mp3, don't forget to: mciSendString("close mp3", NULL, 0, NULL) Īll these actions also apply to (work with) wave files too, but with wave files, you can use "waveaudio" instead of "mpegvideo".Īlso you can just play them directly without opening them: PlaySound("*.wav", GetModuleHandle(NULL), SND_FILENAME) Note that you cannot resume a sound that has been stopped, but only paused, but you can replay it by carrying out the play command. To stop it in middle: mciSendString("stop mp3", NULL, 0, NULL) To pause the *.mp3 in middle: mciSendString("pause mp3", NULL, 0, NULL) Īnd to resume it: mciSendString("resume mp3", NULL, 0, NULL) This is equivalent to: mciSendString("play mp3 repeat notify", NULL, 0, hwnd) //or MAKELONG(hwnd, 0) instead If you only remove the SuspendThread call, then the sound will play over and over again and do something whenever it is over. Of course you can remove the while (true), SuspendThread and the from 0 codes, if you want to play your mp3 file only once and do whatever you want when it is over.

#Acid music studio 10 not opening mp3 file code#

You can #define play_my_mp3 ResumeThread(mp3) to make your code more readable. SuspendThread(GetCurrentThread()) //or the handle of this thread that you keep in a static variable insteadĪll what you have to do now is to ResumeThread(mp3) every time you want to replay your mp3 and something will happen every time it finishes. Do here what you want to do when the mp3 playback is over MciSendString("play mp3 from 0 wait", NULL, 0, NULL) You can prepare this structure before `CreateThread` and give it's address in the `lpParameter`ĭata *data = (Data*)lpParameter //If you call this structure Data, but you can call it whatever you want. Here is the ThreadProc for the lpStartAddress of this thread: DWORD WINAPI MP3Proc(_In_ LPVOID lpParameter) //lpParameter can be a pointer to a structure that store data that you cannot access outside of this function. The type of this static variable is HANDLE of course. In the window procedure, add the case MM_MCINOTIFY: The code in there will be executed when the mp3 has finished playing.īut if you program a Console Application and you don't deal with windows, then you can CreateThread in suspend state by specifying the CREATE_SUSPENDED flag in the dwCreationFlags parameter and keep the return value in a static variable and call it whatever you want. If this doesn't work, then replace the hwnd with MAKELONG(hwnd, 0). If you want to do something when the *.mp3 has finished playing, then you need to RegisterClassEx by the WNDCLASSEX structure, CreateWindowEx and process it's messages with the GetMessage, TranslateMessage and DispatchMessage functions in a while loop and call: mciSendString("play mp3 notify", NULL, 0, hwnd) //hwnd is an handle to the window returned from CreateWindowEx. To play the *.mp3 and replay it every time it ends like a loop: mciSendString("play mp3 repeat", NULL, 0, NULL) To replay and wait until the *.mp3 has finished playing: mciSendString("play mp3 from 0 wait", NULL, 0, NULL) To replay (play again from start) the *.mp3: mciSendString("play mp3 from 0", NULL, 0, NULL) To play and wait until the *.mp3 has finished playing: mciSendString("play mp3 wait", NULL, 0, NULL) To play *.mp3: mciSendString("play mp3", NULL, 0, NULL) To open *.mp3: mciSendString("open \"*.mp3\" type mpegvideo alias mp3", NULL, 0, NULL) these two headers are already included in the header First of all, write the following code: #include









Acid music studio 10 not opening mp3 file