?
Solved

Delphi Programming question

Posted on 1997-09-11
6
Medium Priority
?
163 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
[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
  • 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
Technology Partners: 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!

 
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 200 total points
ID: 1344686
happy programming to you.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month10 days, 15 hours left to enroll

770 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