question about playing midi "resource". 
Author Message
 question about playing midi "resource".

Hi! Everyone!

    I got a question about playing midi "resource".
    I could play wav "resource"  by PlaySound.
    But I wonder if there exists a function like that can play midi
"resource"?
    Would you please give me some hints?
    Thanks a lot! :-)



Sun, 28 Apr 2002 03:00:00 GMT  
 question about playing midi "resource".
Xiaoting,

//don't forget to add mmsystem.lib to
// the import settings of your project

#include <mmsystem.h>
PlaySound("C:\\myfile.mid",NULL,SND_FILENAME | SND_ASYNC);

Quote:

>     I got a question about playing midi "resource".
>     I could play wav "resource"  by PlaySound.
>     But I wonder if there exists a function like that can play midi
> "resource"?

Jim [VC/MFC MVP]
To send mail, change spam-me-not to msn


Sun, 28 Apr 2002 03:00:00 GMT  
 question about playing midi "resource".
Hi Xiaoting,

There are different ways to do it depending on the level of control that you
require.
1.    Insert an ActiveX control (Windows media player)
2.    Sub-class the MCIWnd class which encapsulates the MCI (Media Control
Interface) in a easy to implement window class.  You can play and record
MIDI, wave audiot and video avi's with this class.
3.    Use the MCI media layer in your own window ( easier to implement if
you don't want the User Interface offered in MCIWnd).
4.    Use Stream buffers ({*filter*}, low-level but with much more control and
performance).  This layer is used by commercial sequencers.
5.    Use MIDI Services (only one level of abstraction from the hardware
drivers - very lowlevel - lots of work - complete control).

I wrote a simple sequencer using stream buffers, but for most applications,
MCI is great.  Al the documentation is in the MSDN library...

HTH marcus


Quote:
> Hi! Everyone!

>     I got a question about playing midi "resource".
>     I could play wav "resource"  by PlaySound.
>     But I wonder if there exists a function like that can play midi
> "resource"?
>     Would you please give me some hints?
>     Thanks a lot! :-)



Sun, 28 Apr 2002 03:00:00 GMT  
 question about playing midi "resource".
I couldn't play midi file this way.
The return value is always false.
PlaySound is waveaudio function, could it play midi?
If it does, then I can use SND_RESOURCE...


Quote:
>Xiaoting,

>//don't forget to add mmsystem.lib to
>// the import settings of your project

>#include <mmsystem.h>
>PlaySound("C:\\myfile.mid",NULL,SND_FILENAME | SND_ASYNC);


>>     I got a question about playing midi "resource".
>>     I could play wav "resource"  by PlaySound.
>>     But I wonder if there exists a function like that can play midi
>> "resource"?

>Jim [VC/MFC MVP]
>To send mail, change spam-me-not to msn



Mon, 29 Apr 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Question about playing midi "resource"

2. Playing Midi File from Resource.

3. Play MIDI file as a resource

4. How to play a MIDI RESOURCE FILE?

5. Playing midi resources/files

6. Playing ".avi" files

7. "Microsoft .NET Framework Configuration" + mscorlib.resources

8. "System.Resources.MissingManifestResourceException" in mscorlib.dll

9. "Switching off" loading of resource files

10. MS Resource Localization Toolset: "RLTools"

11. Use of "Insert Resource Copy: Language"?

12. Resource editor "cannot add new member"

 

 
Powered by phpBB® Forum Software