如何改变均衡器的频率?
How to change the frequency of an equalizer?
是否可以改变均衡器频段的频率,或者只能使用 60Hz 230 Hz 910 Hz 3600 Hz 14000 Hz?
我猜你说的是 android.media.audiofx.Equalizer。
不同的Android设备有不同的频段数量,您可以在支持的频段之间自由设置,如docs所说:
setBandLevel(short band, short level)
Sets the given equalizer band to
the given gain value.
Parameters
band - short: frequency band that will have the new gain. The numbering of the bands starts from 0 and ends at (number of bands - 1).
level - short: new gain in millibels that will be set to the given band. getBandLevelRange() will define the maximum and minimum values.
来自 WoodyDev 的回答为我们提供了一些示例代码来获取设备支持的范围:
// New instance of equalizer (add it as a member of your class rather than a scoped instance like this)
Equalizer mEqualizer = new Equalizer(0, mMediaPlayer.getAudioSessionId());
// Get the number of bands available on your device
short bands = mEqualizer.getNumberOfBands();
// Get the gain level available for the bands
final short minEQLevel = mEqualizer.getBandLevelRange()[0];
final short maxEQLevel = mEqualizer.getBandLevelRange()[1];
您可以在这里找到更多意见和帮助:Number of bands in Android Equalizer
是否可以改变均衡器频段的频率,或者只能使用 60Hz 230 Hz 910 Hz 3600 Hz 14000 Hz?
我猜你说的是 android.media.audiofx.Equalizer。
不同的Android设备有不同的频段数量,您可以在支持的频段之间自由设置,如docs所说:
setBandLevel(short band, short level)
Sets the given equalizer band to the given gain value.
Parameters
band - short: frequency band that will have the new gain. The numbering of the bands starts from 0 and ends at (number of bands - 1).
level - short: new gain in millibels that will be set to the given band. getBandLevelRange() will define the maximum and minimum values.
来自 WoodyDev 的回答为我们提供了一些示例代码来获取设备支持的范围:
// New instance of equalizer (add it as a member of your class rather than a scoped instance like this)
Equalizer mEqualizer = new Equalizer(0, mMediaPlayer.getAudioSessionId());
// Get the number of bands available on your device
short bands = mEqualizer.getNumberOfBands();
// Get the gain level available for the bands
final short minEQLevel = mEqualizer.getBandLevelRange()[0];
final short maxEQLevel = mEqualizer.getBandLevelRange()[1];
您可以在这里找到更多意见和帮助:Number of bands in Android Equalizer