Playing MP3 with multi-media library bass. dll [1]-Installation and debugging

Source: Internet
Author: User
Recently I want to write a small Program MP3 playback is used. Because of the complicated control and functions, I think of Bass. dll.

Previously I thought that bass. dll is the Windows system comes with the library, and later I know that the original is a third-party: http://www.un4seen.com /.

Bass. dll has been updated, and the latest version is 2.411,: http://us2.un4seen.com/files/bass24.zip

There are three steps to do before using in Delphi:
1. Copy bass. DLL to a folder that can be recognized by the system, such as Windows \ system32, windows, WINDOWS \ SYSTEM, or any directory specified by the system or user's environment variable path, you can also put it in the current directory during Program Creation, put a folder and specify a path in the program.
2. Place the header file bass. PAS for Delphi in a directory (for example, c: \ Program Files \ codegear \ rad studio \ 6.0 \ imports \ bass24 ).
3, and then from the Delphi menu-> Tools-> options-> Library-Win32-> library path-> and then add this directory (example ).

Okay. Write a few tests:

Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs; Type tform1 = Class (tform) Procedure formcreate (Sender: tobject); end; vaR form1: tform1; implementation {$ R *. DFM} uses bass; Procedure tform1.formcreate (Sender: tobject); begin showmessagefmt ('% x', [bassversion]); {204} showmessagefmt (' % x ', [bass_getversion]); {2040101} If hiword (bass_getversion) Bassversion then showmessage ('current bass. dll version disusable ') else showmessage (' OK! '); End.

  

Program description:

Before using bass, you generally need to verify the version (because different versions have different functions );

The bass_getversion function can obtain the version number of Bass. dll in the system. Here is: $2040101 (hexadecimal number );

Bassversion is a constant in bass. Pas, indicating the version of the Bass. Pas file. Here it is $204;

As long as the main version number (such as 2.4) is consistent, we can use the hiword function from
In the returned values of the bass_getversion function, the major version number is compared with the bassversion number.

Let's take a look at the functions provided by bass for us:

Bytes
 
  
 
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.