简体   繁体   中英

Android programming, how to change voice frequency

I want to play a WAV file at another frequency (300hz, 500hz... ) on Android. Is there any way to do so?

Try using the SoundPool class.

It has a setRate(int streamID, float rate) method. Setting the rate to 1.0 will play at normal speed - setting rate of 2.0 will play at twice the speed and so on.

Changing playback rate will change frequency. If you have a plain tone of 100Hz then a rate of 3.0 will change it to 300Hz and a rate of 5.0 will change it to 500Hz for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM