TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
yaquza yaquza
NA
13
13.7k
Read & Play a Sound file
Jan 25 2012 3:15 AM
Hi
I want Read and play a sound file in c# as byte by byte. this bytes that reading, place in array of byte by lengh 500000. Now i want play this array! Please help me.
System.IO.FileStream fs = new System.IO.FileStream(@"c:\a.wav", System.IO.FileMode.Open);
byte[] buffer = new byte[500000];
byte[] buffer = new byte[500000];
fs.Read(buffer, 0, buffer.Length);
system.IO.Stream s = new system.IO.MemoryStream(buffer);
System.Media.SoundPlayer spPlayer = new System.Media.SoundPlayer(s);
spPlayer.Stream = s;
spPlayer.Stream.Position = 0;
spPlayer.Play();
Please Help what is Problem of my code?
Reply
Answers (
2
)
Object ref not set to an instance of the Object.
Robust Dictionary Exception Handling