Sound & Music

Moderators: Sephiroth
Number of threads: 611
Number of posts: 1220

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
background sound in pascal Posted by Forza on 20 Jul 2001 at 1:53 AM
Hi i have turbo pascal 7. and im doing a project+i want to have my moving graphic moving at the same time as i have my music playing! if anyone can help me with the best option to have these two playing together PLEASE let me know!

Report
Re: background sound in pascal Posted by Jaywalk on 25 Jul 2001 at 3:04 AM
: Hi i have turbo pascal 7. and im doing a project+i want to have my moving graphic moving at the same time as i have my music playing! if anyone can help me with the best option to have these two playing together PLEASE let me know!
:
If you want to use crt to play pc speaker sound, then here is a way which should work well. Define a counter variable, let's call it scount, as a longint (because they can count up really far). Then make a procedure, let's call it DoSound, and call it from somewhere in the main loop. DoSound will (1) increment scount, and (2) play or stop sound based on scount, so that you can control the exact moments sounds are played. Here is an example:

Procedure DoSound;
Begin
Inc(sCount);
Case sCount of
4:sound(200);
900: sound(600);
2000: nosound;
end
end;

This method should work if you have a few sounds which occur at set moments. You may need to play around with the numbers. If you want music, then you could use an array instead.

If you expect a sound card and speakers, you may consider taking advantage of them to play sound files instead of bothering with crt. In this case, I recommend smix 1.30, which you can find in this very site.

Report
Re: background sound in pascal Posted by RiZEN on 15 Aug 2001 at 5:31 AM
: : Hi i have turbo pascal 7. and im doing a project+i want to have my moving graphic moving at the same time as i have my music playing! if anyone can help me with the best option to have these two playing together PLEASE let me know!
: :
: If you want to use crt to play pc speaker sound, then here is a way which should work well. Define a counter variable, let's call it scount, as a longint (because they can count up really far). Then make a procedure, let's call it DoSound, and call it from somewhere in the main loop. DoSound will (1) increment scount, and (2) play or stop sound based on scount, so that you can control the exact moments sounds are played. Here is an example:
:
: Procedure DoSound;
: Begin
: Inc(sCount);
: Case sCount of
: 4:sound(200);
: 900: sound(600);
: 2000: nosound;
: end
: end;
:
: This method should work if you have a few sounds which occur at set moments. You may need to play around with the numbers. If you want music, then you could use an array instead.
:
: If you expect a sound card and speakers, you may consider taking advantage of them to play sound files instead of bothering with crt. In this case, I recommend smix 1.30, which you can find in this very site.
:

Where can I find a sound library for pascal with dpmi support ?



Report
Re: background sound in pascal Posted by FH_prg on 22 Aug 2001 at 8:10 AM

: Where can I find a sound library for pascal with dpmi support ?



you can download this file:
http://www.geocities.com/farzad104/Blaster.zip




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.