ALSA PCM device network streaming - alsa

I am writing an application in C++ intended to stream data from a PCM device (microphone) to a remote server. I have successfully been able to stream a recorded wav file to the server, and I have been able to output the mic input to a file. The next step is to merge my 2 programs...open the PCM device, and then stream what gets put into the buffer to the server.
I have read that I will need to use Pulse Audio to do this because ALSA does not have a server. Is this accurate? Does anyone have any examples or resources? I have had minimal luck trying to research this online.
Thanks in advance!

Thank you! That got me thinking down a different path and was able to just send the buffer using socket programming.

Related

How do I capture the audio of a wpf window or cscore output in c#?

I made a music player in wpf using cscore. Now, I want to add a feature so I can stream the output in real-time (like a radio) to another instance of the music player over internet. I could see how to stream the data later, but first I need to know how to get the bytes of the audio output. I'm asking for help because I'm lost, I've done some research and found nothing but how to stream the desktop audio. That's not a solution, because I want to listen to the same music with some friends while hanging out on Discord, so if I stream the desktop audio, they will listen to themselves besides the music. Any help will be welcome. Thanks in advance!
I am have not used cscore I mainly use naudio a similar library that facilitates getting audio to and from the sound card. So I will try and answer in a way that allows you to find what you are looking for in cscore.
In your player code you will be pulling data from the audio file. In naudio this is done with a audio file reader. I think it is called a wavFileReader in cscore, This file reader translates the audio file into a stream of audio samples in the form of byte arrays, the byte arrays are then used to feed the WASAPI Out to allow the audio to play on the sound card.
The ideal place to start with your streaming system would be in the middle of those two processes. So rather than just passing the audio samples to the sound card you need to take a copy of the byte array containing the samples. it is this data you will need to stream to your friends.
From here you will need to look at compressing the audio and streaming protocols like RTP all can be done in c#. The issue will be, as it always is in audio having your data stream keep pace with the sound card. Every time WASAPIOut asks for more samples you need to have the ready otherwise the audio will be choppy.
I do hope this helps point you in the right direction. Others with experience with cscore may have some code examples to assist you more directly I am simply trying to point you in the right direction

Mux telemetry data into a MPEG-ts file using gstreamer

I recently starting using Gstreamer and I have succeeded in muxing an audio stream and 2 camera streams into a MPEG-TS file using the mpegtsmux and now want to inject telemetry data from an accelerometer into the data stream. I was thinking by using teletext to do that, which is supported by the mpegtsmux and then use the appsrc to inject the data into the pipeline. Does anyone succeeded in doing this before, I can't seem to find any examples with injecting teletext into a data stream.
How about to use the sound channel without compression?
Use the application/x-teletext caps to create pad to the mux..
I'm yet to able successfully do it. If you have, I'd be interested on how you used appsrc.

How to send data from Arduino Uno to PC using the USB port

I'm building an NFC project in which I have an Arduino Uno with a PN532 NFC shield that reads stored messages from tags. What I'm trying to achieve is to store/write the information to a .csv file, but I need to send the data over the USB cable through which the Uno is connected to on my PC.
Is there any way to write the data to .csv file onto the Arduino, then send the .csv file to the PC over the USB cable to a given directory, or write a program that reads the data being sent from the Uno through the USB cable, and then write the data on the PC to a .csv file? I'm aware I could get a breadboard with an SD card reader, and write the data to an SD card but I'm trying to avoid this solution if possible. Is there any way to send files or data over USB from Arduino to PC?
I would definitely have the Arduino send the values over the USB interface and have the host run a Python program that uses the CSV library to write a .csv file.
You could simply "print" the values from the Arduino to the USB interface and read them on the host using /dev/ttyUSBx. But at some point you might want to send control commands to the Arduino. And you might want to do some logging, catch errors, etc. If so, I suggest that you look at a full-fledged communication protocol. I realize you're not controlling a robot, but rosserial from Robot Operating System (ROS) would make this easy. It might feel like overkill but I think you'll appreciate the features once you start using it.
Do you need an example?

Using pcap to parse through a trace file?

I'm currently learning about TCP and packets. I'm working in the C programming language, and I understand how the pcap library can be used to sniff traffic on my computer. But can pcap be used to parse and read through a trace file as well? I need to track the TCP state information from a given trace file.
In a nutshell, I'm curious how I can go about opening a trace file with pcap to parse through it? If someone could get me moving towards the right direction, it would be greatly appreciated!
But can pcap be used to parse and read through a trace file as well?
Yes. Most of the APIs you'd use are the same, but you'd use pcap_open_offline() to open a file rather than using pcap_open_live(), or pcap_create() and pcap_activate(), to open a device for a live capture.

How to program own real time transport protocol for Silverlight Video/Audio Conferencing over a network?

Hi
I have created a Silverlight Application for audio/video conferencing using TCP. But due to slow speed during tranferring stream bytes over the network. While google the situation i find that there is no any support for real time transport protocols, such as RTP in silverlight. So, can anyone guide me or refer some links to perform this task?
Thanks in advance
Any Suggestion or Help will appreciated...
Are you sending the stream in raw bytes? Have you tried sending a compressed byte stream and decompressing it at the other end? This may speed up the transfer process but would cause the client to work harder to decompress it.

Resources