The Quiz


Posted Date:     Total Responses: 0    Posted By: Veerabagu   Member Level: Gold   Points/Cash: 50   


this game is very interesting for beginners to know more about winforms. the main important feature is i added my own voice while generating new questions.

New things what i learned :

1) how to add audio in windows based application
2) how to run 2 audio files synchronously

1) how to add audio in windows based application:

Using System.Media class we add easily audio in our windows application.They are two types to add audio in our application.

1.From Resources
2.From Hard Disk

1) From Resources:

First add the add the audio file in Resources the type the following 2 line of code in button click event or any event

Code:

System.Media.SoundPlayer sound = new System.Media.SoundPlayer();
sound.Stream = Properties.Resources.Veera_Ava_Enna;
sound.PlayLooping();

2) From Hard Disk:
If already audio file exists in hard disk we have to use the following 2 line of code

Code:

System.Media.SoundPlayer sound = new System.Media.SoundPlayer();
sound.SoundLocation = @"D:\veera\Veera – Ava Enna.wav";
sound.Play();
For stop the audio:
sound.Stop();

2) how to run 2 audio files synchronously

if you want to run two audio file synchronously you have to use audio.PlaySync(); function. Without using this function it will directly run the second file try once if you are free.

for example:

audio = new System.Media.SoundPlayer kaunBanegaCrorepati.Properties.Resources.weight);
audio.Play();
audio.PlaySync();
audio = new System.Media.SoundPlayer(kaunBanegaCrorepati.Properties.Resources.intro);
audio.Play();


Attachments

  • The Quiz (567-4431-theQuiz.zip)

  • Project Feedbacks

    Author: Member Level: BronzeRevenue Score: 1 out of 5
    Hi,
    May i know how its working in detail example..


    Author: Member Level: BronzeRevenue Score: 1 out of 5
    Hi,
    May i know how its working in detail example..


    Author: Member Level: BronzeRevenue Score: 1 out of 5
    Hi,
    May i know how its working in detail example..


    Author: Member Level: SilverRevenue Score: 1 out of 5
    good coding yaa


    Author: Member Level: BronzeRevenue Score: 1 out of 5
    nice project man


    cer.txt
    Author: Member Level: BronzeRevenue Score: 1 out of 5
    nice to follow


    .txt
    Author: Member Level: BronzeRevenue Score: 1 out of 5
    Hi,
    Can you explain in detail how its working.

    -Saravanan


    Author: Member Level: BronzeRevenue Score: 1 out of 5
    Hi,
    Can you explain in detail how its working.

    -Saravanan


    Author: Member Level: SilverRevenue Score: 3 out of 53 out of 53 out of 5
    Hi,
    I wish to use this project and iam unable to figure out how to get this program working. if you can put in some help describing how we can use the application it can be helpful to new bies like me
    thanks
    siri


    Author: Member Level: SilverRevenue Score: 3 out of 53 out of 53 out of 5
    Hi,
    I wish to use this project and iam unable to figure out how to get this program working. if you can put in some help describing how we can use the application it can be helpful to new bies like me
    thanks
    siri


    Author: Member Level: GoldRevenue Score: 2 out of 52 out of 5
    Hi,
    Its really nice. I would like learn such type of things.

    It will be greatful for me to send the files.

    Thanks
    Siva Sreenath


    Author: Member Level: GoldRevenue Score: 4 out of 54 out of 54 out of 54 out of 5
    Hi all its a quiz program i am displaying 10 questions one by one.
    then while loading i am generating some music and each questions i am using my
    own voice while generating the questions.

    once download and execute the code you come to understand easily
    the main concept is how we play audio in windows application synchronous and asynchronous manner

    any doubt reply :)

    Regards
    Veera


    Post Feedback
    You must Sign In to post a feedback.
    Next Project: The Dice
    Previous Project: Export Grid to Excel

    Return to Project Index

    Post New Project


    Related Projects


    Top Contributors
    Today
      Last 7 Days
        more...

        Awards & Gifts

        Online Members

        More...
         
        Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India