question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to change sampling rate?

See original GitHub issue

Hello, awesome package! I’ve tried using Lasp.AudioLevelTracker.audioDataSlice to read raw audio data and from it construct a precise size buffer. My use case is a neural network, it has to have a precise length max input, therefore this package seems like a perfect candidate for fast data acquisition. All I’m doing is looping through audioDataSlice[i] and writing values to my buffer until it’s full. Then run inference with it.

Problem: NN Input also requires sample rate of exactly 16000, not more not less. Seems like in this package default is 48 000.

Question: How to change sampling rate from 48000 to 16000? Cannot a way how I’m meant to do it. AudioLevelTracker does not give access to it’s device. I cannot just Lasp.AudioSystem.GetInputDevice(_input.deviceID).SampleRate = 16000;` because there is no setter in SampleRate constructor.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
keijirocommented, Feb 3, 2022
0reactions
Darth-Carrotpiecommented, Feb 10, 2022

For future reference, to anyone who might be interested in this problem, I went on not to change the sampling rate of the device. It proved simpler and a more universal approach (to adapt to various rates of many devices out there) to just resample everyting every few frames. I used NWaves.Operations for that purpose, because most other solutions did not work or did not even load.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Change the Sample Rate of Your Audio
Click on the drop-down menu to the right of Frequency and change your audio sampling rate to 44.1 kHz. Google only accepts audio...
Read more >
Change Signal Sample Rate - MATLAB & Simulink
This example shows how to change the sample rate of a signal. The example has two parts. Part one changes the sample rate...
Read more >
How To Quickly Change Sample Rate in Ableton Live - YouTube
Learn how to quickly change your sample rate without having to drop in your DAW, convert, and reload your stems. Sometimes, you need...
Read more >
Converting sample types
Use sample rate conversion presets · Choose Edit > Convert Sample Type. · Adjust the settings as desired. · Click the New Preset...
Read more >
Set the sample rate of a project in Logic Pro for Mac
Choose File > Project Settings > Audio (or use the Open Audio Project Settings key command), then choose a sample rate from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found