Solved

Delphi Programming question

Posted on 1997-09-11
6
159 Views
Last Modified: 2011-04-14
I want to play the same wav file over and over again,
without accessing the hard disk over and over again.
The length of this file is 1/400 minute, and I want
to play it 400 times a minute without reloading it
from HD. Time is critical here.

Someone said I should use streams: far to complex
to find out on my own.

Can someone give a working example.

1) must run under delphi 2.0
2) the start of the repeating playing must be controlled
(be started) by pressing a Tbutton
3) same for the end
4) the speed (that is when the next repeation is starting
must be variable
5) It must not be a component, but code which can be
inserted in the mainform

Thanks
0
Comment
Question by:luiaard
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:Zonnald
ID: 1344681
luiaard,

the media player can loop if you make the notify event start the player again but this seems to cause a delay.
You really need to somehow build a data structure that contains the wave I will play with it when I can - interesting idea though

Zonnald

0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1344682
this example can help you

var m : TMemoryStream;
begin
  m := TMemoryStream.Create;
  m.LoadFromFile( 'D:\TEST.WAV' );
  sndPlaySound( m.Memory, SND_MEMORY );
  m.Free;
end;
0
 

Author Comment

by:luiaard
ID: 1344683
Thanks Mirek, but I reject your answer because I get:

Undeclared identifier sndPlaySound
Undeclared identifier SND_MEMORY
Could not compile TEST.PAS

What am I doing wrong?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:mirek071497
ID: 1344684
uses
  MMSystem;
0
 

Author Comment

by:luiaard
ID: 1344685
Mirek, it works.
Send in your last comment again please, but make
 it an answer.  Then I will grade it as excellent.

With regards,
Luiaard
0
 
LVL 3

Accepted Solution

by:
mirek071497 earned 100 total points
ID: 1344686
happy programming to you.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connection between libmysql.dll and MySQL Versions 7 112
Delphi Mdi application Child forms get behind control 7 270
Working with hours 3 65
Dynamically Created Query 3 62
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 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