📄 wpw_wapi_multimedia_95.html
字号:
<HTML>
<HR><A NAME=WINAPI_MultiMedia_WAV>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Audio .WAV file</H4><PRE>
In article <3s24ni$hsc@usenet.srv.cis.pitt.edu>
jocst4+@pitt.edu "Jong-chih Chien" writes:
>How does windows provides for recording and storing
>a WAV file within a program? Are certain functions
>within MMSYSTEM.DLL useful?
You need to use the low level audio functions within the multimedia
API. Refer to the SDK manual "Multimedia Programmer's Guide" for details
(it's published as a Microsoft Press book). If you're doing multimedia
programming you NEED this manual!
Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| chris@chrism.demon.co.uk | astronomy program for Windows. |
| For more info, see http://www.winternet.com/~jasc/skymap.html |
| Author member of Association of Shareware Professionals (ASP) |
--------------------------------------------------------------------------
</PRE>
<HR><A NAME=WINAPI_MultiMedia_AU>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Program that play AU file in Windows</H4><PRE>
Joel Bierling (jbierl00@news.calvin.edu) wrote:
: Phil Edwards (intractv@tyrell.net) wrote:
: : In article <3rdaff$epm@nyx10.cs.du.edu> shan@nyx10.cs.du.edu (Steven Han) writes:
: : >From: shan@nyx10.cs.du.edu (Steven Han)
: : >Subject: Re: .au runner for windows?
: : >Date: 10 Jun 1995 17:39:27 -0600
: : >In article <3rd3tr$275@rc1.vub.ac.be>,
: : >CHIELENS klaas <hw49915@vub.ac.be> wrote:
: : >>
: : >>Is there anyone who knows about a program to run .au (from mac) files in
: : >>windows?
: : >>
Try WinPLayAny, it play all kind of Sound-Stuff (.au .snd .raw, .....)
it can be found at
ftp.univie.ac.at/packages/network/mosaic/pc/viewers/wplny09b.zip
--
--------------------------------------------------------
Sebastian Lackner,
E-Mail: h9150022@obelix.wu-wien.ac.at
WWW: http://ds1.wu-wien.ac.at/~h9150022/
--------------------------------------------------------
</PRE>
<HR><A NAME=WINAPI_MultiMedia_MIDI>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: MIDI</H4><PRE>
In article <3s6rrt$5ke@infoserv.netkonect.net>
alan@arwilliamson.netkonect.co.uk "AR Williamson" writes:
> Can someone please help me and clear up a couple of queries?
>
> Under Windows 3.1 API there appears to be no way of controlling the
> MIDI port. The Win32s Section has a whole set of MIDI functions but
> are these 32bit. If they are what is disadvantage of having 16bit
> code with 32bit DLLs.
Is the multimedia library - see mmsystem.h - not enough?
Dave
--
+---------------------------+-----------------------------------+
| Dave Webber dave@musical.demon.co.uk |
| Author of MOZART, the Windows 3.1 shareware Music Processor |
| and member of the Association of Shareware Professionals |
+---------------------------+-----------------------------------+
<HR>
In article <3s6rrt$5ke@infoserv.netkonect.net>,
alan@arwilliamson.netkonect.co.uk says...
>
>Can someone please help me and clear up a couple of queries?
>
>Under Windows 3.1 API there appears to be no way of controlling the
>MIDI port. The Win32s Section has a whole set of MIDI functions but
>are these 32bit. If they are what is disadvantage of having 16bit
>code with 32bit DLLs.
>
I haven't looked at the 32 bit multimedia API, but there definitely
exists a ton of 16 bit multimedia (sound, midi, etc.) API calls. Look
for the Multimedia Programmers Guide/Reference (either a book or a help
file from your compiler vendor).
>Thanks.
>
>AR Williamson
Erik
</PRE>
<HR><A NAME=WINAPI_MultiMedia_SOUND_IN_MEMORY>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Play Sound Data in Memory</H4><PRE>
if you have a file use
sndPlaySound(lpszFile, SND_ASYNC);
If you have a handle to a wav file use
LPSTR pWAV = (LPSTR)GlobalLock(hWAV);
sndPlaySound(pWAV, SND_MEMORY|SND_ASYNC);
GlobalUnlock(hWAV);
As to how to get a handle to a wav, here is a function in C++ to do
it.
// Function reads a wav file into a global memory block and set the
// dwSize variable to the size of the wav.
HANDLE CSoundClass::GetWAV(LPSTR lpszFile, DWORD *dwSize)
{
HANDLE hWAV=NULL;
TRY
{
CFile f(lpszFile, CFile::modeRead);
*dwSize=f.GetLength();
hWAV = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT | GMEM_SHARE,
*dwSize);
if(hWAV == 0)
return NULL;
LPSTR pWAV = (LPSTR)GlobalLock(hWAV);
if(f.ReadHuge(pWAV, *dwSize) != *dwSize)
return NULL;
GlobalUnlock(hWAV);
}
CATCH( CFileException, e )
return NULL;
END_CATCH
return hWAV;
}
Hope this helps.
Andy.
</PRE>
<HR><A NAME=WINAPI_MultiMedia_TIMER>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Use the multimedia timer</H4><PRE>
In article <DBGMnw.6AL@wchat.on.ca>, mroberts@wchat.on.ca (Mark C.
Roberts) wrote:
> Hi everybody:
> This is a final appeal for help to those of you in the land
> of knowledge:
>
> I have been trying for WEEKS to get the Multimedia Timer for
> windows to work. So far, I have been frustrated by one of two
> out comes:
>
> 1. It just doesn't work at all. ie: The timer call back
> function does not seem to get called ever, after
> schedualling an event.
> 2. It gets called - and then it crashes my machine.
>
> Your first problem lies in the following DLL .DEF file statements:
> // ********************************************************************
> // This is the DEF file for the MMTIMER DLL: MMTIMER.DEF
>
> LIBRARY MMTIMER
> DESCRIPTION 'MM Timer DLL for Windows'
> EXETYPE WINDOWS
> CODE PRELOAD MOVEABLE SHARED DISCARDABLE
^^^^^^^^ -- should be FIXED
> DATA PRELOAD MOVEABLE SHARED
^^^^^^^^
should be FIXED if you intend to
access global variables in the DLL
> HEAPSIZE 2048
>
The code for the DLL must be FIXED, not MOVEABLE.
Here is the quote on both of these from the Windows Multimedia help file:
Because the callback is accessed at interrupt time, it must reside in
a DLL adn its code segment must be specified as FIXED in the module
definition file for the DLL. Any data that the callback accesses must
be in a FIXED data segment as well. The callback may not may any system
calls except PostMessage, timeGetSytemTime, timeGetTime, timeSetEvent,
midiOUtShortMsg, midiOutLongMsg, and OutputDebugStr.
Hope that this helps...
-- MC
--
Mark Coniglio -- Troika Ranch / Dance Theater
mail: troika@panix.com
http: www.art.net/Studios/Performance/Dance/Troika_Ranch/TroikaHome.html
</PRE>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -