Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: USB Audio & Frank B's samplerate change code

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Posts
    5

    USB Audio & Frank B's samplerate change code

    Hi,

    I am trying to use a Teensy 3.6 as a soundcard (essentially along the lines of the PassThroughStereo and WavFilePlayerUSB examples), this works perfectly fine at 44.1 kHz for both recording and playback but I would like to run it at 192 ksample/sec. I have tried to use Frank B's sample rate change code but when playing back it seems that the PC still outputs at 44100 sample/sec but the Teensy expects 192 ksample/sec leading to weird sounding audio. When recording and running an FFT on the recorded samples, I can see a clear lowpass characteristic, cutting off at 22050 Hz so something is not in order. Any clues appreciated!

    Wouter Jan PE4WJ

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,579
    Quote Originally Posted by PE4WJ View Post
    Hi,

    I am trying to use a Teensy 3.6 as a soundcard (essentially along the lines of the PassThroughStereo and WavFilePlayerUSB examples), this works perfectly fine at 44.1 kHz for both recording and playback but I would like to run it at 192 ksample/sec. I have tried to use Frank B's sample rate change code but when playing back it seems that the PC still outputs at 44100 sample/sec but the Teensy expects 192 ksample/sec leading to weird sounding audio.
    Can't say much about that, but part of the issue might be this:

    https://github.com/PaulStoffregen/co...usb_dev.c#L472
    (At least it should use the AUDIO_SAMPLE_RATE... unfortunately Paul changed this to 44117 (why?) so some tricks would be needed to correct this)
    I use this: https://github.com/FrankBoesing/Ardu...r/codecs.h#L66


    I'd try to patch these lines and see what happens....
    Last edited by Frank B; 03-25-2020 at 08:53 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •