portaudio

Portaudio Error on Ubuntu and Raspbian

烈酒焚心 提交于 2019-12-24 15:22:09
问题 I recently started to use PortAudio in a C program, but I've got trouble initializing it. The problem lies in the Pa_Initialize() function. Here's my code: #include "portaudio.h" #include <stdio.h> #include <stdlib.h> main() { PaError err; err = Pa_Initialize(); if ( err != paNoError ) goto error; error: Pa_Terminate(); fprintf( stderr, "******* ERROR *******\n" ); fprintf( stderr, "Error number: %d\n", err ); fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); return err; } I

How to pass a member function as a parameter? (PortAudio)

为君一笑 提交于 2019-12-24 10:38:22
问题 I am trying to create multiple streams in portaudio. This is what it requires for opening a stream PaError Pa_OpenDefaultStream( PaStream** stream, int numInputChannels, int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, unsigned long framesPerBuffer, PaStreamCallback *streamCallback, void *userData ); and this is the PaStreamCallback function. typedef int PaStreamCallback( const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo* timeInfo,

Pyaudio: Error when wiring input to output

谁说我不能喝 提交于 2019-12-24 03:53:16
问题 I'm trying out pyaudio on Intel Edison board, but it fails with the build-in tests. Recording and playing alone works fine with my setting, but if I'm trying to wire input to output, it gives an error. File "wire_full.py", line 33, in data = stream.read(CHUNK) File "/usr/lib/python2.7/site-packages/pyaudio.py", line 605, in read return pa.read_stream(self._stream, num_frames) IOError: [Errno Input overflowed] -9981 Does anybody understand what's the problem? Below is the example code for

Error while compiling PortAudio examples

自古美人都是妖i 提交于 2019-12-22 08:59:21
问题 (I am on Ubuntu) I am trying to run the PortAudio examples, but getting many errors (mentioned below). I have placed the header file portaudio.h in the directory of the program. I have no idea about it. I think it is linker error. Please help! /tmp/cc5EbTlT.o: In function main': paex_record.c:(.text+0x37e): undefined reference to Pa_Initialize' paex_record.c:(.text+0x397): undefined reference to Pa_GetDefaultInputDevice' paex_record.c:(.text+0x3de): undefined reference to Pa_GetDeviceInfo'

Building Portaudio on OSX 10.7.5 using SDK10.6 or 10.7 fails

佐手、 提交于 2019-12-21 19:42:40
问题 I am still having trouble building the Portaudio library on my system, which is OSX 10.7.5 with Xcode 4.3.2, having Command Line Tools installed and having SDK10.6 and SDK10.7 under /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ I describe shortly (also for others that run into the same problem) what I have done so far (following different solutions I have found on the web). 1) I downloaded "Portaudio" / pa_stable_v19_20111121.tgz (last stable release)

Pyaudio, portaudio and mac 10.7.5

冷暖自知 提交于 2019-12-21 05:45:13
问题 I'm having trouble installing pyaudio correctly. I have a virtualenv set up for the project. I first tried to install portaudio: sudo port install portaudio which returns: ---> Cleaning portaudio ---> Scanning binaries for linking errors: 100.0% ---> No broken files found. I assume that means it ran fine. Then I tried: pip install pyaudio Which returns: Downloading/unpacking pyaudio Running setup.py egg_info for package pyaudio warning: no files found matching '*.c' under directory 'test'

How to extract frequency information from an input audio stream (using PortAudio)?

北战南征 提交于 2019-12-20 10:58:12
问题 I want to record sound (voice) using PortAudio (PyAudio) and output the corresponding sound wave on the screen. Hopeless as I am, I am unable to extract the frequency information from the audio stream so that I can draw it in Hz/time form. Here's an example code snippet that records and plays recorded audio for five seconds, in case it helps any: p = pyaudio.PyAudio() chunk = 1024 seconds = 5 stream = p.open(format=pyaudio.paInt16, channels=1, rate=44100, input=True, output=True) for i in

How to extract frequency information from an input audio stream (using PortAudio)?

匆匆过客 提交于 2019-12-20 10:58:08
问题 I want to record sound (voice) using PortAudio (PyAudio) and output the corresponding sound wave on the screen. Hopeless as I am, I am unable to extract the frequency information from the audio stream so that I can draw it in Hz/time form. Here's an example code snippet that records and plays recorded audio for five seconds, in case it helps any: p = pyaudio.PyAudio() chunk = 1024 seconds = 5 stream = p.open(format=pyaudio.paInt16, channels=1, rate=44100, input=True, output=True) for i in

Implementing simple high and low pass filters in C

余生颓废 提交于 2019-12-20 09:45:24
问题 Trying to use portaudio to record some data, then use an algorithmic filter to change the recorded voice and then play it back. I've verified a lot of it (coming from example) but I'm quite new to C and I think in my filter implementation I've done something silly. #if LOW_PASS { float RC = 1.0/(CUTOFF*2*3.14); float dt = 1.0/SAMPLE_RATE; float alpha = dt/(RC+dt); float filteredArray[numSamples]; filteredArray[0] = data.recordedSamples[0]; for(i=1; i<numSamples; i++){ filteredArray[i] =

PortAudio real-time audio processing for continuous input stream

拈花ヽ惹草 提交于 2019-12-20 02:32:47
问题 I am using PortAudio to implement a real-time audio processing. My primary task is to acquire data from mic continuously and provide 100 samples for processing (each FRAME = 100 samples at a time) to some other processing thread. Here is my callback collecting 100 samples each time on a continuous basis - static int paStreamCallback( const void* input, void* output, unsigned long samplesPerFrame, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void* userData ) {