mcisendstring

How can you fix this error from mciSendString() and make it play a sound?

你。 提交于 2021-01-29 11:25:21
问题 I wish to use mciSendString to play a basic wav file, from a point say 20 seconds from the beginning of the audio. I have tried using it to just open and play a basic wav file in the same directory as the program, however to no avail. This is the basic code I have: int main() { char lpszReturnString[16384]; MCI_PLAY_PARMS song = { NULL, 0, 15 }; MCIERROR open = mciSendString("open \"C:\\Users\\ethan\\source\\repos\\Project2\\Project2\\America.wav\" type waveaudio alias America",

How to specify a sound card for use with mciSendString API

旧城冷巷雨未停 提交于 2021-01-27 19:42:03
问题 I am updating an old VB6 app. Back in the day, I coded a wrapper around the mciSendString command to be able to record and playback audio. Back then, computers typically had a single audio card. Now, many of the customers have multiple sound cards (typically a built in one and a USB headset). I can't seem to find the API to specify which sound card to use with mciSendString. Can someone point me in the right direction? 回答1: Please check out several solutions here with sourcecode (Ergebnisse

Playing mp3 files with mciSendString (MCIERR_CANNOT_LOAD_DRIVER)

空扰寡人 提交于 2020-01-04 03:41:05
问题 I am trying to write some code that can play an .mp3 file. I thought I could use the mciSendString call, but I am getting a strange error. So, when I have this code: int rc=mciSendString(L"open songname.mp3 alias song1", NULL, 0, 0); rc returns with the number 266, and the error string returned with GetErrorString was: "Unknown problem while loading the specified device driver." Error 266 is MCIERR_CANNOT_LOAD_DRIVER I have also tried: int rc=mciSendString(L"open songname.mp3 type mpegvideo

mciSendString cannot save to directory path

若如初见. 提交于 2019-12-25 04:33:29
问题 VS C# 2008 SP1 I have a created a small application that records and plays audio. However, my application needs to save the wave file to the application data directory on the users computer. The mciSendString takes a C style string as a parameter and has to be in 8.3 format. However, my problem is I can't get it to save. And what is strange is sometime it does and sometimes it doesn't. Howver, most of the time is failes. However, if I save directly to the C drive it works first time

Is there a way to pause/stop a mp3 file playing with mcisendstring with the “wait” option?

我与影子孤独终老i 提交于 2019-12-13 02:40:03
问题 I am currently trying to create an mp3 player with the commands offered in this answer. Actually it's working pretty great, but right now I am trying to implement a continuos play with mciSendString("play mp3 wait", NULL, 0, NULL); This command is supposed to play an mp3 file from start to finish and wait until it has actually finished playing. This is working correctly, however, I was convinced before trying it out, that pause or stop commands which work with usual play would work here as