From: "Genial" Subject: Re: Two sounds at once Date: 21 Nov 1999 00:00:00 GMT Message-ID: <818tgt$ac92@forums.borland.com> References: <3836FE16.4E165585@cypresslane.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.delphi.winapi How are you calling for the sounds to play - MCI or sndPlaySound or what. The Delphi code below plays two sounds concurrently under Win95, you could extend it. I think concurrent sound playing relies on the driver supporting multiple inputs, and I believe you could request if it has this capability before trying to play. Hope this helps Genival P.Carvalho - Sao Paulo - Brazil procedure TForm1.Button1Click(Sender: TObject); begin SendMCICommand('open waveaudio shareable'); SendMCICommand('play hickory.wav'); SendMCICommand('play greeting.wav'); SendMCICommand('close waveaudio'); end; procedure TForm1.SendMCICommand(Cmd : string); var RetVal : integer; ErrMsg : array[0..254] of char; begin RetVal := mciSendString(StrAsPChar(Cmd), nil, 0, 0); if RetVal <> 0 then begin {get message for returned value} mciGetErrorString(RetVal, ErrMsg, 255); MessageDlg(StrPas(ErrMsg), mtError, [mbOK], 0); end; end; function StrAsPChar(var S : OpenString) : PChar; {returns a PChar from a string} begin if Length(S) = High(S) then dec(S[0]); S[Ord(Length(s)) + 1] := #0; Result := @S[1]; end; Russell Wilson escreveu nas notícias de mensagem:3836FE16.4E165585@cypresslane.com... > I'd like to have a background .wav file playing and once in a while have > a short effects .wav sound play at the same time (without interrupting > [stopping & restarting it] the background .wav). > > Anyone have experience with this or know where to look? My search has > found nothing so far. > > Thanks for any help! > -- > Russell Wilson > Cypress Lane Diversions http://www.cypresslane.com > ____________________________________________________ > home of Mah Jongg Wall - a unique solitaire game > June 1998 GAMES magazine > 1998 ZD Shareware Awards > http://www.hotfiles.com/?000MJN