Menu

SampleRate conversion

Help
weiheng
2005-11-22
2012-09-22
  • weiheng

    weiheng - 2005-11-22

    Hi all,

    I'm modifying helloworld sample to do a simple speech recognition app. I'm using acoustic model from helloworld demo. But my ibook can only support 44100hz audio format. So I want to convert sample rate from 44100hz to 16000hz. Is it possible?

    Or there is other alternative? Thanks.

     
    • The Grand Janitor

      Sox? -Arthur

       
    • weiheng

      weiheng - 2005-11-24

      Sox? mind to elaborate more? Thanks.

       
      • Anonymous

        Anonymous - 2005-11-24

        Sox is a free utility for converting audio files from one format to another. It also can perform several signal processing functions, one of which is sample rate conversion. I think it's available for Linux and Windows, but not Mac OS (but you could run it under OS X's native Un*x). See http://sox.sourceforge.net/ .

        But when you say, "my ibook can only support 44100hz audio format", I infer that you wish to convert 44.1 kHz live microphone audio rather than audio files to the 16 kHz rate.
        1. There is a sample-rate conversion capability in Apple's sound manager library. We have used it in a speech reco product, but that was two jobs ago, and I cannot now supply any details. As I recall, it's not obvious how to do it, but it works.
        2. Failing that, you have to implement it yourself, a digital signal processing operation involving upsampling, lowpass filtering, then downsampling. Up/downsampling by 4/11 yields 16167 Hz, which is probably close enough.
        3. Even easier but much less exact is simply to discard 2 out of every 3 audio samples thus downsampling by 3 without any filtering. This will cause some "aliasing" distortion, and the resulting sample rate comes out to 14700 Hz, which is 8% low, but it might work well enough for your "simple speech recognition app". (Note that if your iBook could operate the audio input at 44 kHz, then downsampling by 3 comes out to 16 kHz exactly!)

        Good luck!
        cheers,
        jerry

         
      • Anonymous

        Anonymous - 2005-11-24

        Correction to #3 above: in "if your iBook could operate the audio input at 44 kHz", please change "44 kHz" to "48.0 kHz".

         
    • weiheng

      weiheng - 2005-11-25

      I've tried to convert audiostream from live microphone using tritonus plugins. And it works. At least I don't notice any significant difference. :)

      Thanks anyway.

       
    • Anonymous

      Anonymous - 2005-11-29

      Weiheng -- others would be interested if you could give more details about how you used the Tritonus plugins to convert the audio input stream from 44.1 to 16 kHz. Please tell us more. Thanks.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.