改变播放mp3的QTMovie的音量(Changing the volume of a QTMovie playing an mp3)

我正在使用QTMovie播放音轨。 我刚开始使用音量控制,并使用setVolume更改音量:(float)newVolume。 我遇到的问题是音量变化看起来非常非常小。 我尝试过改变0到10和0到128(最大值)之间的音量,并且很难检测到响度差异。

有没有人有任何这方面的经验,可以指出我做错了什么?

I'm using a QTMovie to play audio tracks. I've just started playing around with the volume controls and I'm changing the volume using setVolume:(float)newVolume. The problem I'm having is that the volume change seems very very miniscule. I have tried varying the volume between 0 and 10 and 0 and 128 (the maximum) and the difference in loudness is very hard to detect.

Is there anyone with any experience of this that could point out something I'm doing wrong?

最满意答案

我正在使用QTMovie播放音轨。 我刚开始使用音量控制,并使用setVolume更改音量:(float)newVolume。 我遇到的问题是音量变化看起来非常非常小。 我尝试过改变0到10和0到128(最大值)之间的音量,并且很难检测到响度差异。

差别很难检测,因为没有一个。

setVolume:采用浮点小数,并将其视为整数。 范围从0.0到1.0,如volume方法的文档中所述 :

volume

以float类型的标量值形式返回影片的音量。

- (float)volume 讨论

有效范围是0.0到1.0。

该文档没有说明当您尝试设置超出范围的值时会发生什么; 我的猜测是,它目前钳位到1.0,因此所有大于或等于1.0的值最终为1.0,因为响度完全没有差异。

I'm using a QTMovie to play audio tracks. I've just started playing around with the volume controls and I'm changing the volume using setVolume:(float)newVolume. The problem I'm having is that the volume change seems very very miniscule. I have tried varying the volume between 0 and 10 and 0 and 128 (the maximum) and the difference in loudness is very hard to detect.

The difference is hard to detect because there isn't one.

setVolume: takes a floating-point fraction, and you're treating it as an integer. The range is from 0.0 to 1.0, as documented in the documentation for the volume method:

volume

Returns the movie’s volume as a scalar value of type float.

- (float)volume Discussion

The valid range is 0.0 to 1.0.

The documentation doesn't specify what happens when you try to set an out-of-range value; my guess is that it currently clamps to 1.0, so all values greater than or equal to 1.0 end up as 1.0, for exactly no difference in loudness.

改变播放mp3的QTMovie的音量(Changing the volume of a QTMovie playing an mp3)

我正在使用QTMovie播放音轨。 我刚开始使用音量控制,并使用setVolume更改音量:(float)newVolume。 我遇到的问题是音量变化看起来非常非常小。 我尝试过改变0到10和0到128(最大值)之间的音量,并且很难检测到响度差异。

有没有人有任何这方面的经验,可以指出我做错了什么?

I'm using a QTMovie to play audio tracks. I've just started playing around with the volume controls and I'm changing the volume using setVolume:(float)newVolume. The problem I'm having is that the volume change seems very very miniscule. I have tried varying the volume between 0 and 10 and 0 and 128 (the maximum) and the difference in loudness is very hard to detect.

Is there anyone with any experience of this that could point out something I'm doing wrong?

最满意答案

我正在使用QTMovie播放音轨。 我刚开始使用音量控制,并使用setVolume更改音量:(float)newVolume。 我遇到的问题是音量变化看起来非常非常小。 我尝试过改变0到10和0到128(最大值)之间的音量,并且很难检测到响度差异。

差别很难检测,因为没有一个。

setVolume:采用浮点小数,并将其视为整数。 范围从0.0到1.0,如volume方法的文档中所述 :

volume

以float类型的标量值形式返回影片的音量。

- (float)volume 讨论

有效范围是0.0到1.0。

该文档没有说明当您尝试设置超出范围的值时会发生什么; 我的猜测是,它目前钳位到1.0,因此所有大于或等于1.0的值最终为1.0,因为响度完全没有差异。

I'm using a QTMovie to play audio tracks. I've just started playing around with the volume controls and I'm changing the volume using setVolume:(float)newVolume. The problem I'm having is that the volume change seems very very miniscule. I have tried varying the volume between 0 and 10 and 0 and 128 (the maximum) and the difference in loudness is very hard to detect.

The difference is hard to detect because there isn't one.

setVolume: takes a floating-point fraction, and you're treating it as an integer. The range is from 0.0 to 1.0, as documented in the documentation for the volume method:

volume

Returns the movie’s volume as a scalar value of type float.

- (float)volume Discussion

The valid range is 0.0 to 1.0.

The documentation doesn't specify what happens when you try to set an out-of-range value; my guess is that it currently clamps to 1.0, so all values greater than or equal to 1.0 end up as 1.0, for exactly no difference in loudness.