Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using Microsoft.DirectX.AudioVideoPlayback;
 public static void  playNote (string pass)
        {
        Audio myAudio = new Audio(pass);
        myAudio.Play();
        }

i ve got this method for my virtual piano
when i press button

playNote("PianoDo#.wav");

but uf i press a lot of buttons for 30 sec my app starts lagging because of CPU
Is there another method which is lighter?Or playing several sounds from stream?
Posted

Take a look at this article[^]. Playing wav files will surely reduce the performance.
 
Share this answer
 
i mean not to play midi,but how to play files from resources so that sounds will not iterrupt each other,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900