紧急求助,MediaPlay组件如何控制左右声道?

mxp 2000-08-22 04:25:00
...全文
348 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
mxp 2000-08-31
  • 打赏
  • 举报
回复
Thank!
to cheka: 安装xing是不理想的步骤
to feng: 用DirectX也会遇到不兼容问题
to jumphigh: 综合来看,还是您的方案好一些
to seeking: mcisendstring是什么东东?!!我还不清楚
to Nicrosoft: 无奈的世界也还是有人有能耐,嘻嘻!

feng 2000-08-29
  • 打赏
  • 举报
回复
请看这个贴子,已解决问题的“ 如何控制左右声道(非左右音箱)???“
cheka 2000-08-29
  • 打赏
  • 举报
回复
我写过一个小控件,可以配合MediaPlay实现Mpeg的左右声道操作

下载 : cheka.163.net/someting.htm
jumphigh 2000-08-28
  • 打赏
  • 举报
回复
没碰上过
你说的程序异常退出
是何现象呢
mxp 2000-08-28
  • 打赏
  • 举报
回复
非常感谢jumphigh,但用api如果程序异常退出,其他Windows程序也变成单声道了,有没有只用程序控制的。

请问seeking:不好意思,mcisendstring是什么东东?帮助中没找到,能详细说明一下吗?

mxp 2000-08-28
  • 打赏
  • 举报
回复
就是声道不能复位,有人就喜欢用结束任务来关闭程序#¥#·¥*%

jumphigh知道mcisendstring是什么东东吗?
jumphigh 2000-08-27
  • 打赏
  • 举报
回复
MMRESULT waveOutGetVolume(HWAVEOUT hwo, LPDWORD pdwVolume);



Retrieves the current volume level of the specified waveform-audio output device.

?Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:

MMSYSERR_INVALHANDLE Specified device handle is invalid.
MMSYSERR_NODRIVER No device driver is present.
MMSYSERR_NOMEM Unable to allocate or lock memory.
MMSYSERR_NOTSUPPORTED Function isn't supported.
hwo

Handle of an open waveform-audio output device.

pdwVolume

Address of a variable to be filled with the current volume setting. The low-order word of this location contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.
If a device does not support both left and right volume control, the low-order word of the specified location contains the mono volume level.
The full 16-bit setting(s) set with the waveOutSetVolume function is returned, regardless of whether the device supports the full 16 bits of volume-level control.

Not all devices support volume changes. To determine whether the device supports volume control, use the WAVECAPS_VOLUME flag to test the dwSupport member of the WAVEOUTCAPS structure (filled by the waveOutGetDevCaps function).
To determine whether the device supports left- and right-channel volume control, use the WAVECAPS_LRVOLUME flag to test the dwSupport member of the WAVEOUTCAPS structure (filled by waveOutGetDevCaps).

Volume settings are interpreted logarithmically. This means the perceived increase in volume is the same when increasing the volume level from 0x5000 to 0x6000 as it is from 0x4000 to 0x5000.
jumphigh 2000-08-27
  • 打赏
  • 举报
回复
The waveOutSetVolume function sets the volume level of the specified waveform-audio output device.

MMRESULT waveOutSetVolume(

HWAVEOUT hwo,
DWORD dwVolume
);


Parameters

hwo

Handle of an open waveform-audio output device. This parameter can also be a device identifier.

dwVolume

New volume setting. The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.
If a device does not support both left and right volume control, the low-order word of dwVolume specifies the volume level, and the high-order word is ignored.



Return Values

Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:

MMSYSERR_INVALHANDLE Specified device handle is invalid.
MMSYSERR_NODRIVER No device driver is present.
MMSYSERR_NOMEM Unable to allocate or lock memory.
MMSYSERR_NOTSUPPORTED Function is not supported.


Remarks

If a device identifier is used, then the result of the waveOutSetVolume call applies to all instances of the device. If a device handle is used, then the result applies only to the instance of the device referenced by the device handle.
Not all devices support volume changes. To determine whether the device supports volume control, use the WAVECAPS_VOLUME flag to test the dwSupport member of the WAVEOUTCAPS structure (filled by the waveOutGetDevCaps function). To determine whether the device supports volume control on both the left and right channels, use the WAVECAPS_LRVOLUME flag.

Most devices do not support the full 16 bits of volume-level control and will not use the high-order bits of the requested volume setting. For example, for a device that supports 4 bits of volume control, requested volume level values of 0x4000, 0x4FFF, and 0x43BE all produce the same physical volume setting: 0x4000. The waveOutGetVolume function returns the full 16-bit setting set with waveOutSetVolume.
Volume settings are interpreted logarithmically. This means the perceived increase in volume is the same when increasing the volume level from 0x5000 to 0x6000 as it is from 0x4000 to 0x5000.

See Also

WAVEOUTCAPS, waveOutGetDevCaps, waveOutGetVolume
jumphigh 2000-08-27
  • 打赏
  • 举报
回复
procedure tform1.trackbar1changer (sender:tobject);//左声道
var t,v:longint;
begin
t:=trackbar1.postion;
wavoutgetvolume(0,@v);
v:=v and $ffff0000 or (t shl 8);
wavoutsetvolume(0,v);
end;

procedure tform1.trackbar2changer (sender:tobject);//右声道
var t,v:longint;
begin
t:=trackbar2.postion;
wavoutgetvolume(0,@v);
v:=v and $0000ffff or (t shl 24);
wavoutsetvolume(0,v);
end;
seeking 2000-08-27
  • 打赏
  • 举报
回复
老兄,用mcisendstring不就行了吗?!!!!!!!!
Nicrosoft 2000-08-24
  • 打赏
  • 举报
回复
无奈的世界。
mxp 2000-08-24
  • 打赏
  • 举报
回复
世界真无奈!
mxp 2000-08-22
  • 打赏
  • 举报
回复
有没有替代方案,不是播放.wav,是播放.mpg文件!!
有视频!

Nicrosoft 2000-08-22
  • 打赏
  • 举报
回复
没有办法的。

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧