Capture audio stream from Xtion pro with OpenNI2? - audio

Dose any one try to captured the audio stream using OpenNI2 library from Xtion pro??
I searched the Internet and found the audio API in OpenNI2 source code. Audio API
It seems that it only can "Play" the audio but capture audio stream.
And it doesn't demonstrate how to use those API.
Is there any example code which recorded the audio stream using OpenNI2 from Xtion pro?
BTW, my OpenNI version is 2.2.0.33.
Thanks anyone's help : )

After I surveyed so much information, I found that OpenNI2 didn't support the audio stream anymore. Hence, someone suggest me to use another library to capture audio stream from Xtion Pro.
Now, I'm using the PortAudio to deal with the audio stream. It's quit powerful tool and easy to use.
Moreover, it's cross-platform library which support Windows, Mac OS, and Unix using C/C++, and the Documentation is clear and the example code is understandable.
So, if some newbies like me want to use Xtion Pro to capture audio stream, I will recommend this library.
Any other suggestions are very welcome : )

Related

Read loopback audio on linux

I'm trying to make an audio visualizer on Linux but I can't seem to find any library that allows me to read the sound levels of the audio of the system. All the libraries I seem to come across seem to either be for reading the microphone or for recording the system audio.
I've tried using pyaudio but for some reason, I've only been able to open the microphone and while the program is running the audio coming out of the speakers then gets distorted.
edit: I'm using PulseAudio but I would be fine switching to another sound driver like alsa, etc.

How implement real time video encoding using Libde265 and Linux

I been reading a lot about H265 encoder but I'm no really sure how to start a C or Python application to encode a video stream in real time using H.265 encoder from libde265, I all ready install the library and I guess I could use opencv to get the input video stream from a usb camera, do anyone has worked in this type of application ?
If you are not particular about using libde265, which I am not aware of, please give a shot with gstreamer. gstreamer has lots of plugins and examples if you are doing some standard tasks like encoding on your stream. It also integrates well with native development.
I have worked on a project similar to yours, where we did H264 encoding and decoding along with few other things on a live camera feed.
Please find the video of a similar application here: https://www.youtube.com/watch?v=JcpkGDpfVU0
Just my two cents!!

How to do audio stream processing in Linux(RPi) via C?

Hej
I would like to build an audio effect into a RPi. This effect should be programmed in C. I am not familiar with the software audio interfaces in Linux. The ALSA interface looks very complicated. Port Audio seems to be an alternative.
Any ideas(maybe with a tutorial)?
With some work you can also get OpenAL to stream and render audio using c language - then you could perform your processing in that context ...
Node.js is available on RPi which offers audio modules
PortAudio seems the best approach. A good tutorial can be found here:
http://portaudio.com/docs/v19-doxydocs/tutorial_start.html
Sometimes the Interface configuration needs to be done manually.

Play audio as microphone input

I am to test voice recognition programs. Some which I have access to the code and others where I don't.
Sadly my (beautiful) voice is not perfect, so when I am reading a text it sounds slightly different each time. Which makes the testing difficult and time consuming. Giving that I can tweak a lot of parameters.
So I was wondering if there was a way to record my own voice (already done). And then play it as normal microphone input so the voice recognition program I am testing will see it as microphone input.
This would also help greatly if it could be done programatically in C#. So I can in my own code specify when to play what.
To play it from speakers and have the voice recognition programs listen to the microphone is not an option, because it is not the same sound on different computers/speakers/microphones.
Thanks.
Edit:
What i have found so far is to use a software sound Card simulator. But I haven't been able to find a suitable one.
Just as there are printer drivers that do not connect to a printer at all but rather write to a PDF file, analogously there are virtual audio drivers available that do not connect to a physical microphone at all but can pipe input from other sources such as files or other programs.
I hope I'm not breaking any rules by recommending free/donation software, but VB-Audio Virtual Cable should let you create a pair of virtual input and output audio devices. Then you could play an MP3 into the virtual output device and then set the virtual input device as your "microphone". In theory I think that should work.
If all else fails, you could always roll your own virtual audio driver. Microsoft provides some sample code but unfortunately it is not applicable to the older Windows XP audio model. There is probably sample code available for XP too.

Capturing microphone audio using Naudio + WASAPI?

I am looking for an example code on how to capture microphone audio using Naudio + WASAPI.
(I am not interested in direct to disk recording, what i need is to process the input buffer in realtime in order to do some audio effects.)
I've searched a lot, but could not find any decent sample online.
Can you please help?
P.S. BASS library and C# examples are welcome as well!
The NAudio source code comes with a demo app that shows how to capture audio using WASAPI. Look in NAudioDemo\RecordingDemo\RecordingPanel.cs.
MSDN has a lot of code samples, though not covering NAudio they do have a few samples that show in detail how to use the Windows Audio Session API.
Since WASAPI is a native-only API there are both sample projects that show you how to use that API from a native-only app Here as well as samples that show you how to build a native component that wraps the API for consumption from a CSharp application. I couldn't find the direct link to the C#/C++-sample but it's included in the Windows 8 App Samples package. Then there's the option of writing a managed wrapper for the API altogether but unless you enjoy pain and are looking for an adventure in marshaling I wouldn't recommend it...
If you're developing for Windows Phone then there's a VOIP-sample in the WP8 SDK that covers how to capture and render PCM audio data using WASAPI.
As Mark pointed out, the size of the pcm data buffer might differ over time and this is in part due to the fact that WASAPI is a low-latency Audio API and therefore has as little abstraction between the consumer (your app) and the producer (the driver) as possible. Though there's nothing that stops you from doing some fixes size buffering of your own and only pass on the data to your app when your own buffer is full.

Resources