mci

mciSendString won't play an audio file if path is too long

人走茶凉 提交于 2021-02-19 01:30:08
问题 When the path+filename of a file is really long, I've noticed that PlaySound(fName.c_str(), NULL, SND_ASYNC); works, but not mciSendString((L"open \"" + fName + L"\" type waveaudio alias sample").c_str(), NULL, 0, NULL); mciSendString(L"play sample", NULL, 0, NULL); Example of failing command: open "C:\qisdjqldlkjsqdjqdqjslkdjqlksjlkdjqsldjlqjsdjqdksq\dajdjqjdlqjdlkjazejoizajoijoifjoifjdsfjsfszjfoijdsjfoijdsoifoidsjfojdsofjdsoijfoisjfoijoisdjfosjfqsd\Windows Critical Stop.wav" type waveaudio

“A problem occurred in initializing MCI” playsound issues

こ雲淡風輕ζ 提交于 2021-01-27 11:50:23
问题 I'm trying to use playsound to play a file within the folder of my code, however very time I run my code it seems it is able to call the file however I always recieve this output: playsound.PlaysoundException: Error 277 for command: open "para.mp3" alias playsound_0.9208788744295284 A problem occurred in initializing MCI. The code that is run is just the use of the playsound function: from playsound import playsound playsound("01. Humongous.mp3") I'm unsure if this is just an issue with my

“A problem occurred in initializing MCI” playsound issues

淺唱寂寞╮ 提交于 2021-01-27 11:43:06
问题 I'm trying to use playsound to play a file within the folder of my code, however very time I run my code it seems it is able to call the file however I always recieve this output: playsound.PlaysoundException: Error 277 for command: open "para.mp3" alias playsound_0.9208788744295284 A problem occurred in initializing MCI. The code that is run is just the use of the playsound function: from playsound import playsound playsound("01. Humongous.mp3") I'm unsure if this is just an issue with my

Start and stop MediaElement at specific times

微笑、不失礼 提交于 2020-01-01 14:56:08
问题 I am change an app over to WPF, it plays audio and video and pictures all based on timed events .. I used "string MciCommand = string.Format("play frames FROM {0} to {1} {2}"" , before. I have been searching and trying to fix this problem now in WPF c# I have a video (wmv) and I have multiple sections that need to be played together. example .. section1 start(200ms) stop(250ms) section2 start(5000ms) stop(15000ms) finally I need it to pause on a a still frame .. I have tried using a timer,

MP3 playing using mci send string c++

允我心安 提交于 2019-12-22 14:09:00
问题 I'm trying to play some mp3 files as my background music in one of my project which Im doing. I tried to play it using mcisendstring but it just couldnt work :( These what I have done: CMP3_MCI myMp3; std::string address= "C:\\Users\\music embed testing\\test.mp3"; myMp3.Load(address); myMp3.Play(); //Load function void Load(string szFileName) { m_szFileName = szFileName; Load2(); } //load2 function void Load2() { std::string szCommand = "open \"" + GetFileName() + "\" type mpegvideo alias "

How to change default sound playback device programmatically?

笑着哭i 提交于 2019-12-17 10:34:14
问题 How to change the default default audio device for playback and recording in vista programmatically ? Is there any registry setting for it like sound manager in window XP? Which API does it? 回答1: There is no public API which allows you to change the default audio device, that is functionality that is considered to be under the users control. This has always been the case in Windows. Having said that, if you search the web, there are a number of people who have reverse engineered the APIs that

How to change default sound playback device programmatically?

拟墨画扇 提交于 2019-12-17 10:34:13
问题 How to change the default default audio device for playback and recording in vista programmatically ? Is there any registry setting for it like sound manager in window XP? Which API does it? 回答1: There is no public API which allows you to change the default audio device, that is functionality that is considered to be under the users control. This has always been the case in Windows. Having said that, if you search the web, there are a number of people who have reverse engineered the APIs that

Does mciSendString must have “wait” in order to hear sound?

强颜欢笑 提交于 2019-12-12 13:15:55
问题 I'm trying to write a mp3 player using mci functions.(win 7 64bit,vs2010,c++) when i try to play a mp3 file with the flag "wait" i can hear the file but everything else is stuck until the file ends playing, if i remove the flag "wait" i can continue working but can't hear a thing. here is a sample of the code: unsigned long __stdcall PlayThread(void *myParam) { char* nameOfMp3 = (char*)myParam; char* cmd = new char[MAX_PATH]; sprintf(cmd,"open \"%s\" type MPEGvideo alias myFile",nameOfMp3);

why mciSendString() to get status position fails in my code?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 03:48:11
问题 Is there any way to query mci device to query current playing position so that we can resume from there to play later on ? cmd.Format(L"status %d waveaudio position",m_iDeviceIDPlayer); mcirez = mciSendString(cmd,buff.GetBuffer(),1024, NULL); it gives this error : "The specified device is not open or is not recognized by MCI " Is there any problem with command ? 回答1: MCI_STATUS_PARMS status; status.dwItem = MCI_STATUS_POSITION; status.dwCallback = 0; dwReturn = mciSendCommand(m

Playback 24bit audio not possible

这一生的挚爱 提交于 2019-12-06 20:01:26
问题 I'm trying to play a 24bit audio file with my AutoHotkey app. It just uses SoundPlay. Windows 7 has no problem, however Windows XP users cannot play the 24bit files. The documentation says: All Windows OSes should be able to play .wav files. However, other files (.mp3, .avi, etc.) might not be playable if the right codecs or features aren't installed on the OS. Possible fixes mentioned in the article How to play 24bit WAV files in Windows Media Player are fixing the problem for Windows Media