Solved

Delphi Programming question

Posted on 1997-09-11
6
160 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
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!

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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