Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MultiWaves/AudioTracks+Waves Simultan

Posted on 1999-07-24
13
Medium Priority
?
321 Views
Last Modified: 2010-04-04
Try to play CDPlayer Audio tracks and Wave simultaneously,
but it only works, if the *.wav isn`t on the same CDROM(-drive). (It works, when the wave is on harddisk) The other chance of playing musik and spoken text simultaneously is playing multiwaves at the same time, but i don`t know, how ?
0
Comment
Question by:Indefrei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 1

Author Comment

by:Indefrei
ID: 1390976
Excuse my english, please

0
 
LVL 17

Expert Comment

by:inthe
ID: 1390977
Hi
i have a component that may help called dwavemix,this is from  readdme file:
This package is a translation of the WaveMix DLL to Delphi. It allows multiple wave files to be played simultaneously until a maximum of 8 separate channels. There's no need of external DLL or INI files.This product is freeware.

if that would be a help let me now and i send it you.
Regards Barry
0
 
LVL 15

Expert Comment

by:simonet
ID: 1390978
Indefrei,

For both hardware and software limitations, Windows (and PCs in general) won't let you play 2 sumultaneous wave files. What you have to do is to mix them up, creating a third wave file (which can reside entirely in memory if you want) which will then be send to the sound card. There can be up to 8 wave files mixed, and they can be of different types: AIF, MID, WAVE, MP3, etc. Using the links below you'll be able to gather all kinds of info on the subject:

http://www.undu.com/Articles/980228a.htm
http://www.undu.com/Articles/980422c.htm

The links above point to the 2 parts of an article entitled "Digital Sound and Music in Delphi", and will show you exactly how to do what you want (and it even goes further). Make sure you read the articles thouroughly and download the libraries.

The techniques described are the same ones used in game engines, and the sound library, MIDAS, has been incorporated by many games as well.

Yours,

Alex
Athena's Place: http://www.bhnet.com.br/~simonet
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:roosiedb
ID: 1390979
Hi,

A very professional package to use for this purpose is the SwiftSoft-package (www.swiftsoft.de).
They have a couple Delphi-components which you can use for multiple-playing WAV-files (but also for multiple playing MP3-files, etc.).
I hope this works...

RoosieDB
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1390980
Alex, did you receive my e-mail?
0
 
LVL 1

Expert Comment

by:bcrotaz
ID: 1390981
Isn't there a limit of 8-bit audio with the WaveMix DLL?

Bryan
0
 
LVL 1

Author Comment

by:Indefrei
ID: 1390982
Hi, Barry,
First of all thanks for your tip.
I`ve found `dwavemix` at Delphi`s Superpage, so you must not send it to me.
Well, it works fine, good enough for my purposes (soundquality), but i have two problems with it.
May be you can help again .(because you do have the component).
1. The default init sets the mixing to MONO. How Sterero ?  [WaveMixConfigureInit ?]
2.  When is the playing of a wave (or wavequeue) in one channel finished.
      I have to notify it somehow !  [ #WaveMixPlay ? ]
//    procedure Play( Channel: Integer; Wave: PMixWave; WndNotify: TWinControl; Flags: Longint; Loops: Word );
     w[2] := WaveMix1.OpenFromFile('manang124.wav');
     WaveMix1.Play( 2, w[2],      ! nil !       , WMIX_QUEUEWAVE, 0 );
Hmm, i know , had to find out it myself, but I`m - still - not used to all those HWND, wincontrol, handles, records, their params and ....
Perhaps you do have a little example , I`m to old and nearly dizzy from all these try `n error....
in case it would be a little larger, my email
scherpenbergerq@t-online.de
Anyway, now i try to find out how to give the points to you, i think it won`t function automatically;
ja ja , always this "first time"stuff...
regards
Indi
0
 
LVL 1

Author Comment

by:Indefrei
ID: 1390983
Correction:
my email
      scherpenberger@t-online.de
sorry

Alex
http://www.undu.com/Articles/980228a.htm 
is not available these days.....

0
 
LVL 17

Accepted Solution

by:
inthe earned 150 total points
ID: 1390984
glad the component helped though unforunatly it is not one i have ever used before(always a maybe tommorrow component)
i have the torry web site (www.torry.ru) on cd which contained this comonent that is how i knew about it.
anyway the following is all i could find out:
hope it is a help but probably not..
it's a pity the documentation is so poor else it could be easier to use.


unit Main;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, WaveMix;

type
  TForm1 = class(TForm)
    WaveMix1: TWaveMix;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button5Click(Sender: TObject);
  private
    { Private declarations }
  public
    wavs: array [0..3] of PMixWave;
    CONF : PMixConfig;  //couldnt get this part right :-(
//you could then use the conf.blah := blah etc then wavemixconfiginit(conf);
    mix: TMixConfig;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
 begin
  Mix.wSamplingRate:=44; {khz}
 mix.wChannels:=2; {aparently 1 is mono,2 is stereo}
//dunno if that works but it's supposed to..

wavs[0] :=  WaveMix1.OpenFromFile('1.wav');
wavs[1] :=  WaveMix1.OpenFromFile('2.wav');
wavs[2] :=  WaveMix1.OpenFromFile('3.wav');
wavs[3] :=  WaveMix1.OpenFromFile('4.wav');

 end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
WaveMix1.Close( wavs[0] );
WaveMix1.Close( wavs[1] );
WaveMix1.Close( wavs[2] );
WaveMix1.Close( wavs[3] );
Wavemix1.FlushAllChannels(true);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
wavemix1.Play(1,Wavs[3],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(1,Wavs[2],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(1,Wavs[1],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(1,Wavs[0],nil,WMIX_QUEUEWAVE,0);

wavemix1.Play(2,Wavs[0],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(2,Wavs[1],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(2,Wavs[2],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(2,Wavs[3],nil,WMIX_QUEUEWAVE,0);

wavemix1.Play(3,Wavs[1],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(3,Wavs[3],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(3,Wavs[0],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(3,Wavs[2],nil,WMIX_QUEUEWAVE,0);

wavemix1.Play(0,Wavs[2],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(0,Wavs[0],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(0,Wavs[3],nil,WMIX_QUEUEWAVE,0);
wavemix1.Play(0,Wavs[1],nil,WMIX_QUEUEWAVE,0);


end;

end.

and that as much as i know..
Regards Barry
might be an idea to search around dejanews and you might get more info that helps you..


0
 
LVL 1

Author Comment

by:Indefrei
ID: 1390985
Hi, Inthe
Thanks for your answer, tomorrow i try to find out if it works.
But even then, i`m afraid, i can`t handle point 2 of my question, because
I don`t know

TMixPlayParams = record         {Storage record for WMixPlay}
      Size: Word;          {Record size}
      hMixSession: THandle;    {WaveMix session handle}
      iChannel: Integer;    {Play on channel(0 to 7)}
      lpMixWave: PMixWave;      {Memory pointer to Wave file}
      hWndNotify: HWND;        {Handle to send MM_WOM_DONE message to}
      dwFlags: Longint;      {Play flags (see below)}
      wLoops: Word;         {# of times to loop ($FFFF = indefinite)}


1. How to preset hMixSession and
                               HwndNotify  
WaveMix1.Play(1, w[1],        nil        , WMIX_QUEUEWAVE, 0 );
               How preset this     NIL !

Espacially because
procedure Play( Channel: Integer; Wave: PMixWave;
         WndNotify: TWinControl; Flags: Longint; Loops: Word );


Wndnotify is tWinControl and hWndnotify is HWND
(and the last gives the information i need)

And i yet don`t know how this works together

2. Maybe I have to preset all the 5 records (sometimes with things i dont know where to get it from)
Then I can forget about it because:
A). it will be to much for me (but i`ll try it tomorrow)
B). The duration of pictures (and movies) of my shows now depends on the length of spoken text files,
because it´s not to handle with this unpredictable timer.
(Perhaps this is the wrong organisation, but which one is a better one)

Well, i don`t wanna go down to your nerves. For sure you will get your points but
thats not the only sence of it all, i think
After all it`s only a question of how to use functions, isn`t it.

By the way what is "search for dejanews" I only know (a lots of ) dejavue

Thanks again for your exertion
Regards Indi
0
 
LVL 17

Expert Comment

by:inthe
ID: 1390986
>>what is "search for dejanews"

well if you ask a question here and only get half an answer or need more details than we can give(on rare occations :o)
then you should also search dejanews :
dejanews is a huge collection of all newsgroup postings.

copy and paste the following url (yes both lines) into your internet browser url box and press enter:

http://www.deja.com/dnquery.xp?DBS=1&VW=&QRY=delphi+mmsystem&svcclass=dnserver

then you see what is dejanews ;-)
and maybe find some more infromation on this subject
Regards Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 1390987
>>(yes both lines)

oops it came out on 1 line :o)
0
 
LVL 1

Author Comment

by:Indefrei
ID: 1390988
Well, Barry
thanks for informing about dejanews, but in this case it`s really amazing,
because you made something like a suicide.
see answer 1 to dwavemix problems at the deja site. (Soundcardproblems)
It stroke me down and i`m gonna gimme time to think over  .
But, nevertheless, i like this kind of a story and
thats worth to give the promised points.
Go on with your patience to beginners like me
Had fun
Regards Indi


0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question