C # explore wave mp3 players

Source: Internet
Author: User

I'm bored recently. I want to listen to songs. Poor new computers have only two or three songs. To listen to other songs, you have to play them on old computers. However, the old but robust book was ruthlessly occupied by his wife. Helpless.

Think about it. You have to write a program to play it. Make a C/S player.

The ideal is beautiful, and the reality is cruel. After tedious search and testing, I found NAdio (

 

,

  • When FileStream or MemoryStream is used, the stream must be,. Note that.
  • You cannot use a section of the Wave file to play the video.
  • Stream attribute specifies the Stream to be played

 

  • When determining the file type, first determine the Wave file. If the file is not a wave file, use Mp3Freame to determine whether the file is an mp3 file.
  • If you use the WaveOut playback provided by the NAudio library, note that when the file is playedPlaybackState will not be set to PlaybackState. StoppedThis requires manual judgment.
  • To get/setProgress,Time,Volume, You need to use
  • The Volume of the Volume in the NAudio library has a problem. Use the default value.


 

  • Some examples are provided in the source file of NAudio.
  • In the webpage of http://naudio.codeplex.com,Projects Using NAudioThere are also some
  • Of course, the better thing isHow do I ...?There is a life-saving code for playing Wave and Mp3.
  • There is also an article about A Simple C # Player Mp3 with NAudio.

 

We all know that the basic components of the player include:Volume Control,Progress Control,Time Display,Play,Pause,StopAnd events triggered at the end of the playback. So,

 

AudioPlayer is the player object, but the actual playback operation is completed by NAudio. So,

Use AudioCore to complete the actual playing of NAudio. So how do I operate the volume, progress, and display time? These areAudioVolume AudioTimePosition.

 

 

OK. All objects have been created. You only need to combine them to work. Next we will do a practical test.

Let's talk about Journey to the West.

The end seems to be a little faster. Hi ~ Hi ~, This is efficiency. Code. If you are interested, you can useReflectorDecompile goldli. Utility. AudioPlayer. dll. Send an email if any problem occurs. Flash

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.