Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1016395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:32:34+00:00 2026-05-16T10:32:34+00:00

I wish to multiple .wav files simultaneously in delphi. When I open and plat

  • 0

I wish to multiple .wav files simultaneously in delphi.

When I open and plat the first things are fine.
However the second one causes a error when it tries to open.

It would appear that i can only use one media player at a time…. is there any way around this what do i do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:32:35+00:00Added an answer on May 16, 2026 at 10:32 am

    How would you play a single sound? When I want fine control, I use the waveOut functions, as in this answer. My answer there also allows you to play the sound using a thread (that is, among other things, asynchronically). I think that you can play two sounds at the same time, by simply starting two such threads at the same time, if you only replace global vars with global threadvars.

    Update

    The simplest way to play a single sound is to use PlaySound. This can be used asynchronically, but since you ask this question, I assume that this does not allow you to use this function twice in a row to start simultaneous playback of two files. But: If you create a thread that only plays the sound (synchronically so that the thread doesn’t die before the playback is finnished), then you can probably use two such threads to play two audio files simultaneously. (I have no access to a Delphi compiler right now, so I am afraid that I cannot test my hypotheses.)

    Update 2

    My hypothesis was that you could use two calls to PlaySound if only the function was called from two different threads, but apparently that is not good enough. You really need two different processes, it seems, which is bad (to state the obvious). I tried

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      with TSoundPlayerThread.Create(true) do
      begin
        SetFileName('C:\Users\Andreas Rejbrand\Downloads\Anna.wav');
        FreeOnTerminate := true;
        Resume;
      end;
    
      with TSoundPlayerThread.Create(true) do
      begin
        SetFileName('C:\Users\Andreas Rejbrand\Downloads\Mike.wav');
        FreeOnTerminate := true;
        Resume;
      end;
    end;
    

    with

    unit SoundPlayerThread;
    
    interface
    
    uses
      Classes, MMSystem, Windows;
    
    type
      TSoundPlayerThread = class(TThread)
      private
        { Private declarations }
        FAudioFileName: string;
      protected
        procedure Execute; override;
      public
        procedure SetFileName(const FileName: string);
      end;
    
    implementation
    
    procedure TSoundPlayerThread.Execute;
    begin
      PlaySound(PChar(FAudioFileName), 0, SND_SYNC);
    end;
    
    procedure TSoundPlayerThread.SetFileName(const FileName: string);
    begin
      FAudioFileName := FileName;
    end;
    
    end.
    

    and only the latter wave file was played.

    Update 3

    I have actually written a small WAV file library. Using this, I can load two WAV files, merge them, and send the result to the audio driver. However, it is too much code to post here. If I get time left some day I might write a more lightweight PlaySimultaneously procedure and post it.

    Otherwise: DirectX?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our system one client may have multiple operators. However there is a wish
I have multiple NSStrings and i wish to merge them into one other, here
I wish to use the AVFoundation to load and play movie files. The first
I wish to deploy multiple instances of wcf webservice using MSI installer.When i tried
I have multiple 'bars' which I wish to resize and drag along a x-axis.
I wish to edit ini files over web server, decided to use django, been
Here is i wish to do. I want to have multiple webview loading their
I wish to have two threads. The first thread1 occasionally calls the following pseudo
I do understand that there's no multiple inheritence in C#. However, I've run into
I have a gridview with checkbox inside asp:TemplateField . I wish to select multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.