Source: Skynet
Currently, the popular way to listen to songs is to download them online, instead of searching for them at audio stores. The method used by the karaoke bar is generally to log on to the site that provides MP3 music download, or use a search engine to search for it, and then use the download tool to download it. But can we directly listen online without downloading? The answer is yes. There are already such websites on the Internet, such as music.ustc.edu.cn and music.trueice.net. When you click the selected song, he calls the client's music playing software to play it; this is amazing. We can build such a website for my idol, but I don't know how to program it. Can this work? The answer is no problem at all. There are currently many open-source music playing website programs on the Internet. We can use these programs without having to write a piece of code. You just need to modify the configuration slightly. Of course, you must have an independent host and domain name. Next, I will introduce you to an open-source music playing website program named edna Based on Python.
Python Introduction
During the Christmas of 1989, Guido van rosum, founder of Python, developed a completely new script Interpretation Language to solve some problems in the ABC programming language designed earlier for teaching, this language absorbs the advantages of the ABC language and combines the Unix Shell and C habits. He is a fan of Monty Python's flying circus, so he chose Python to name it. Python was compiled successfully on MAC, but now it can run on various mainstream operating platforms in the world.
Although Python is called "scripting language", it is widely used in some large-scale software development plans, such as Zope, BitTorrent, and Google. Python fans generally refer to it as a high-order dynamic programming language, because "scripting language" generally refers to being used as a simple programming task such as shell scripts, python cannot be compared with programming languages such as JavaScript that can only process simple tasks. It is a real object-oriented programming language. Compared with C ++ and other languages, it has the advantages of rapid development and code opening, and supports network development and large-scale database development. It can be used in many occasions, such as efficient text processing, integration of different programming environments and software functions, and graphical interface programming. There are still many games made using Python. Currently, two well-known Python-based applications are Zope and Plone. The former is an open-source Web application server, it can be used to easily build content management, intranets, portals, and other custom applications, while the latter is a user-friendly and powerful open-source content management system built on the former, this tool is suitable for internal/external network servers, document publishing systems, portal servers, and Remote Collaborative Group tools.
The Chinese Wikipedia (http://zh.wikipedia.org) is the introduction of Python: Python, is an object-oriented explanatory computer programming language, is also a powerful and comprehensive general language, it has a development history of more than ten years, mature and stable. This language is very simple and clear syntax, suitable for completing a variety of high-level tasks, almost all operating systems can run. At present, technologies based on this language are rapidly developing, the number of users is rapidly expanding, and there are a lot of related resources.
Python development environment:
· BlackAdder: http://www.thekompany.com/products/blackadder
· Wing IDE: http://wingware.com/
· Boa Constructor: http://boa-constructor.sourceforge.net/
· IDLE: http://www.python.org/idle/
Python resource sites:
· Python home: http://www.python.org
· Chinese Python user group: http://python.cn/
· Python: http://dohao.org/python
· Python game development site: http://pygame.org/
· Python scientific database: http://scipy.org/
· Python Enterprise Application Development Kit: http://peak.telecommunity.com/
Python environment Installation
Windows users can access the http://www.python.org/download/ to get the latest Python installation package, the latest version is 2.4.1, generally select Windows binary does not contain the installation version of the source file. After downloading it to your local computer, double-click the program to Install it. The dialog box shown in Figure 1 appears. Select Install for all users and click Next.
Figure 2 shows the installation directory of the Python environment, which is generally the default installation directory. You can also select a custom installation path. Click Next to go to the Next step.
Figure 3 shows which Python components are installed, keep the default settings, and click Next.
Click Next to start the program installation, as shown in figure 4.
Figure 5 shows the completed installation dialog box. At this point, the Python parser and related components are installed on the local machine, and you can program and parse the Python language.
Figure 5 [NextPage]Edna program Introduction
Edna is an open-source music playing website program based on the Python language. It supports access to music resources on remote servers through the network, of course, to listen to wonderful songs, you still need the client's music player to support network playback. However, this is not a problem. Currently, most popular music players have this function, such as Winamp, FreeAmp, sonique, XMMS, and Windows Media Player.
Edna supports the following features:
· Supports Deamon settings for Unix machines and startup of Windows Services
· Perfect Chinese support
· Set the website hierarchy based on the music file directory structurePersonalized settings
Edna provides personalized functions for Web pages, which are defined using templates. The template configuration file on the diansong page is default. ezt In the templates folder, and the statistics page is stats. ezt. You can modify the style based on your needs and HTML tags. To display the ID3 Tag of each track on the webpage, open the edna. conf file and edit it as follows:
### Set the absolute path of the templates folder and set the template file to default_complex.ezt Template-dir = C: \ Documents ents and Settings \ Administrator \ Desktop \ edna-0.5 \ templates Template = default_complex.ezt
# Enable ID3 Tag settings
Fileinfo = 1 |
Restart edna once, and the display effect is 10. You can see information about mp3 files displayed on the webpage, such as the author, album name, length, size, and speed.
Postscript
Edna is a simple web-based karaoke System Implemented by Python, and it is open-source. Therefore, if you are interested, you can modify the program on your own, it releases more energy and brings good music to friends on the Internet.
· Multiple webpage song Ordering Methods: album song ordering (sequential or random), single play
· Display the upload time of server songs
· Support for album Image Display
· Collect statistics on service traffic and related access information
· Server-side custom configuration
Edna configuration and operation
Edna can be downloaded from the http://edna.sourceforge.net/, the latest version is 0.5. The installation of edna is simple. After downloading it, decompress it using tools such as winrar or winzip, and modify the configuration file. Go to the edna directory, find the configuration file edna. conf, and edit it (mark "#" as the comment line before the line ).
# # Edna. conf -- configuration file for edna. py # # Port = the following content is the http service port. The default value is 8080. [Server] Port = 8080 # Set the template directory and file for the karaoke page. The page is displayed based on the template. The default value is default. ezt. # Template-dir = templates # Template = default. ezt
# If you want to display id3 tags of an mp3 file, use default_complex.ezt to cancel the # comment mark. # Template = default_complex.ezt # Display information about mp3 files, which is generally time-consuming and disabled by default. # Fileinfo = 1
# |
|