Solved

Delphi Programming question

Posted on 1997-09-11
6
156 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Expert Comment

by:mirek071497
Comment Utility
uses
  MMSystem;
0
 

Author Comment

by:luiaard
Comment Utility
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
Comment Utility
happy programming to you.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now