waveInOpen - All sampling rates are supported?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wizche
    New Member
    • Jul 2008
    • 6

    waveInOpen - All sampling rates are supported?

    Hi Everybody,

    I'm trying to play a little with waveIn functions... My goal is to calculate if I'm listening a specified sin frequency or not.

    For this reason I'm going down with the samplerate... How can I be sure of the sampling rate set on my device?
    If I declare waveFormat.nSam plesPerSec = 9441000; waveInOpen return NO error.. (same if I put 500 Hz) But I'm not really sure that's working (9 MHz!!)...

    For example if I want to find a 500Hz sinwave I need to sample at 2000Hz.. (4 times more the searched freq). In this way I should get the 0 / 1 / 0 / -1 sequency but I need to be sure that my audio device is sampling at that samplerate (and not only that my WAVEFORMAT structure is accepted) otherwise my calculations will be wrong.

    There's any way to get this data direct from the device?

    Thanks for attention.

    Sergio
  • Savage
    Recognized Expert Top Contributor
    • Feb 2007
    • 1759

    #2
    Try calling IsFormatSupport ed

    Comment

    • wizche
      New Member
      • Jul 2008
      • 6

      #3
      Hi, Thanks for reply,
      As I said, I already capture the result of waveInOpen (with WAVE_FORMAT_QUE RY flag) and with 9 Mhz this return NO ERROR. (MMSYSERR_NOERR OR)

      If I change for example the deep to 32 bits this raise me an error, or if I set 10 channels is also returning a BADFORMAT error...

      It seems to be only the samplingrate that doesnt work as it should!

      Comment

      • Savage
        Recognized Expert Top Contributor
        • Feb 2007
        • 1759

        #4
        Originally posted by wizche
        Hi, Thanks for reply,
        As I said, I already capture the result of waveInOpen (with WAVE_FORMAT_QUE RY flag) and with 9 Mhz this return NO ERROR. (MMSYSERR_NOERR OR)

        If I change for example the deep to 32 bits this raise me an error, or if I set 10 channels is also returning a BADFORMAT error...

        It seems to be only the samplingrate that doesnt work as it should!
        Well,if IsFormatSupport ed() pass then I think it's guaranteed that format is supported.
        You can try calling waveInGetDevCap s
        to obtain device capabilities but i think it will only get standard values.

        I don't know of any other method to check device caps,so it's on you to try it out.Never actually tried to do something like that.

        Comment

        Working...