Article View: borland.public.cppbuilder.multimedia
Article #597Re: PlaySound from memory is misbehaving
From: Alec Yu
Date: Sun, 09 Nov 2003 13:18
Date: Sun, 09 Nov 2003 13:18
67 lines
3151 bytes
3151 bytes
Excuse me, can you tell me where i can get VCL for DirectX controls?
Thanks
Alec
Marcelo R. Lopez, Jr. wrote:
> Chuck,
>
> What leads you to believe that your target audio device can have more than
> one MCI audio instance open at a time. Remember, DirectX's sound interface
> is NOT like the MCI ( which is what PlaySound() uses ). You can only have
> more than one audio instance open, IFF your device supports it ( many do
> not ). If you need this sort of functionality, look around on the web, I
> think there are a couple of ( at least semi ) freeware VCL's that will allow
> you to open a DirectX sound device and play multiple streams.
>
> Marcelo R. Lopez, Jr.
>
> "Professor Chuck Kelly" <ckelly@monroeccc.edu> wrote in message
> news:3e823943$1@newsgroups.borland.com...
>
>>I am attempting to play several wav files from memory using PlaySound.
>
> Usually the first time I attempt to play the sounds I only hear the last
> sound. On some computers there is a random delay between playing each sound.
> Sometimes only the last sound plays.
>
>>I am using the following function to play the sounds:
>>
>>void __fastcall TForm1::playSoundMemAsync(int waveIndex, bool &result)
>>{
>> result = PlaySound(wavemem[waveIndex], NULL,
>> SND_ASYNC | SND_NOSTOP | SND_MEMORY);
>>}
>>
>>The function is called as follows:
>>
>>// attempt to play all 4 sounds asynchronously
>>void __fastcall TForm1::PlayAsyncClick(TObject *Sender)
>>{
>> bool status;
>>
>> playSoundMemAsync(0, status);
>> do{
>> playSoundMemAsync(1, status);
>> }while(status == false);
>> do{
>> playSoundMemAsync(2, status);
>> }while(status == false);
>> do{
>> playSoundMemAsync(3, status);
>> }while(status == false);
>>
>>}
>>
>>A complete program using the above functions is available at
>
> http://www.monroeccc.edu/ckelly/Files/SoundTest.zip
>
>>Any suggestions would be appreciated.
>>
>>Prof. Chuck Kelly
>>Monroe County Community College
>>
>
>
>
Technical Details
Message-ID:
<3fae3f0b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3e823943$1@newsgroups.borland.com> <3e9c26b1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,3feb2ec91c58cbad,start X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2003-11-09 05:39:02 PST Date: Sun, 09 Nov 2003 21:18:54 +0800 From: Alec Yu <aqhyu@excite.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en, zh-cn, zh, zh-hk, zh-tw MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.multimedia Subject: Re: PlaySound from memory is misbehaving References: <3e823943$1@newsgroups.borland.com> <3e9c26b1@newsgroups.borland.com> In-Reply-To: <3e9c26b1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 203.99.146.195 Message-ID: <3fae3f0b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1068384011 203.99.146.195 (9 Nov 2003 05:20:11 -0700) Lines: 68 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail