Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

background sound in pascal

ForzaForza Posts: 1Member
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!

Comments

  • JaywalkJaywalk Posts: 105Member
    : 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.

  • RiZENRiZEN Posts: 9Member
    : : 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 ?



  • FH_prgFH_prg Posts: 10Member

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



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

Sign In or Register to comment.