Questions tagged [sample-rate]
157 questions
3
votes
1 answer
SoX: Premature EOF on .wav input file
I've got a bunch of WAV files and a script that copies them to another directory, but processes some of the files with SoX. The outputted files should all have 1 channel and have a sample rate of 44.1khz or less. Most of my files either have more…

Protofall
- 612
- 1
- 6
- 15
3
votes
1 answer
swift AVAudioEngine and AVAudioSinkNode sampleRate convert
I have been having issues with this for a while now, and have written the following swift file that can be run on as the main view controller file for an app. Upon execution, it will play a short blast of a 1kHz sine wave. It will simultaneously…

samp17
- 547
- 1
- 4
- 16
3
votes
0 answers
How can I get the bit depth/sample rate of audio JS?
I need to get the Sample Rate of Audio file, loaded by standard input element.
I tried to use this function
function func(e) {
let reader = new FileReader();
reader.readAsArrayBuffer(e.files[0]);
reader.onload = function(event) {
…

Vera
- 51
- 1
- 6
3
votes
1 answer
How to downsample audio recorded from mic realtime in javascript?
I am using following javascript to record audio and send it to a websocket server:
const recordAudio = () =>
new Promise(async resolve => {
const constraints = {
audio: {
sampleSize: 16,
…

iamanidiot
- 33
- 1
- 5
3
votes
0 answers
fft doesnt work for 44100 sample rate
I have been asking several questions here before about analyzing a FSK signal. I am generating and recording a fsk signal with sample rate of 44100, it contains two frequencies, 934Hz for '1' and 510Hz for '0', the encoded message is a string which…

just_code_it
- 41
- 1
- 5
3
votes
1 answer
How do you get the current sample rate of Windows audio playback?
I am using the Windows waveOut API (aka MME or Multimedia Extension) mmsystem.h. Some programs change the audio playback sample rate (eg. from 44.1kHz to 48kHz), and it would be very useful for my program to detect the current playback sample rate,…

Blake
- 156
- 1
- 9
3
votes
0 answers
Sample rate & format conversion with LibAV API (libavresample)
I'm writing a code which will merge multiple audios (with different formats) and create a single audio. When i set the encoder sample_rate and sample_fmt same with the input videos i have no problem merging the audios. However as obvious, all of the…

buzyeli
- 76
- 6
3
votes
1 answer
Using a particle filter with multiple sensors with different sampling rates
Current situation:
I have implemented a particle filter for an indoor localisation system. It uses fingerprints of the magnetic field. The implementation of the particle filter is pretty straight forward:
I create all particles uniformly…

Mr.Floppy
- 348
- 1
- 9
2
votes
1 answer
How to know the byte offset of a specific CBR MP3 frame?
I created my own MP3 frame parser. I can read each frame individually if I do it sequentially.
My problem is that I have yet to figure out how to find the byte offset of the nth frame (without having to read all the prior frames).
CBR makes this…

Maxime Dupré
- 5,319
- 7
- 38
- 72
2
votes
1 answer
How to get the sample rate of a microphone/input device using Javascript?
When you create a new AudioContext it sets the sample rate to the default output device. This is expected default behavior. Does anyone know if there is there any way to get the sample rate of the input device in Javascript?
We can see in the docs…

avoliva
- 3,181
- 5
- 23
- 37
2
votes
0 answers
After twaillio call required condition is false: format.sampleRate == hwFormat.sampleRate'
This is working fine until I make a call using a twillo framework and again start listening. it is crashing with the following error
required condition is false: format.sampleRate == hwFormat.sampleRate'
it is crashing on this line…

Anoop
- 21
- 3
2
votes
0 answers
Is it possible to set the output audio sample rate for a video file created using AVMutableComposition and AVAssetExportSession?
I'm using AVMutableComposition and AVAssetExportSession to combine a silent MP4 video with a WAV audio file. The basic steps are:
Create AVAssets for the video and audio
Add tracks to the AVMutableComposition
Add each AVAssets first track to a…

Luke
- 7,110
- 6
- 45
- 74
2
votes
1 answer
ffmpeg limit audio sample rate
in order to save space on my home NAS I want to convert plenty of different videos to more efficient codes.
Is there a way to limit the sampling rate to 44 100Hz in order to convert 48 000Hz to 44.1kHz but to keep Videos with 22 050Hz at that…

Ben Schmidt
- 67
- 1
- 6
2
votes
1 answer
Changing sample rate of mp3 files
I have a large amount of mp3 files that are not the correct sample rate for the external hardware I want to use them in. Is there any way of changing them all in one go rather than file by file through audacity?

Gearoid Sheehan
- 23
- 3
2
votes
1 answer
How can you get the sample rate frequency of the iphone accelerometer?
Is there a function or method to get the iphone's current sampling rate of the running accelerometer?
I know how to set the iPhone accelerometer to a certain frequency, but I would like to verify that it is actually running at that frequency
It…

jcpennypincher
- 3,970
- 5
- 31
- 44