A summary of the multimedia audio track in Delphi development

Source: Internet
Author: User

Recently, in the Forum often see asked to switch tracks and switch channels of the problem. Make a summary here. We can reprint. Let the rookie gain! Reprint, the author wants to maintain the original information to the maximum extent!

1, what is sound (sound) rail, channel?

In the earlier VCD era, a media file had only one track. So the word "track" is not often mentioned. VCD media files in the accompaniment or original singing, only by switching left and right channels to achieve.

The track is a "product" of the DVD. In a DVD (MPEG2 format) media file, a track is used to record a language ("original singing" and "accompaniment", often said in VOD).

2. How to switch audio tracks?

Here, I recommend using the "Morgan Stream switcher" Filter.

Audio track switching, generally using the filter on the implementation of the Iamstreamselect interface in the Enable method.

Cases:

var
 obj: IAMStreamSelect;
begin
 if Filter.QueryInterface(IID_IAMStreamSelect, obj) = S_OK then
 begin
  obj.Enable(Index{音轨}, AMSTREAMSELECTENABLE_ENABLE);
  obj := nil;
 end;
end;

3, if the switch channel?

To switch the channel, you need to obtain the Ibasicaudio interface on the audio Renderer filter (hint: The Ibasicaudio interface of the Shenlong card is obtained on hardware decoder filter).

The Put_balance method of the interface can be used to switch the channel.

Incoming value Description: -10000---Right channel

10000---left channel

0---Stereo

4. How to know the audio track number of media files?

In general, when you play a media file, you need the file Source-> Splitter.

Depending on splitter filter is different. There are different ways to get them.

For example, some MPEG splitter, with several tracks, create several audio output pins. In this case, you can obtain the number of audio output pins on the splitter filter (that is, the number of tracks) There are also some MPEG splitter, regardless of the number of tracks, will only output a audio outputs Pin. In this case, the Iamstreamselect interface has been implemented on the splitter. Call the Count method on this interface to get the number of tracks.

5, the problem that leads to

After the channel is switched, only one speaker is audible. It is recommended that you use the Tbalncer Audio channel equalization control.

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.