Arduino UNO audio output with R2R DAC - audio

I'm trying to implement audio output using R2R 8bit DAC and Arduino UNO.
This is my hardware:
http://imgur.com/a/hiUCq
This is the sound i want to hear:
http://vocaroo.com/i/s0VDwBBkQRdc
This is a wav file, 16Khz, mono, 8 bit pcm.
I used matlab to retrieve the binary data from the wav file, and then wrote this code:
http://csharppad.com/gist/0f39da965e31fc838c6de73ff50e5669
I connected the output to some speaker and what i hear is some strange sound..do you think i miss something in my hardware/software?
Thanks!

Related

How do I record audio using a microphone and play it in a speaker simultaneously by only storing one sec of Audio in LINUX

I am now working on a Audio algorithm which need 256 samples of audio from a micro phone and i need to process this 256 samples and result should get played on a speaker. I have done it using two wave file which is already on the file, now i need to do it in the real time.
Need a solution for this

Can Linux determine the parameters of an S/PDIF stream?

I have an external audio source that transmits audio data to my computer's sound card via S/PDIF. The sound card has an S/PDIF input. With "arecord" or "audacity" I can record over this input without any problems.
The audio source offers the data in different sample rates (32 kHz, 44.1 kHz, 48 kHz) which I cannot influence. I also can't tell from the source which sample rate the audio source has selected.
For "recording" I would now very much like to keep the sample rate and not have it converted (apparently by the sound card).
Now finally my question: Can I somehow detect with the help of Linux in which format and with which parameters the S/PDIF stream is encoded

Linux: how to dump audio output PCM bit stream like tcpdump

I am trying to do some audio debugging on my Linux system.
I learned how to record the sound of the current playing media but how can I get the PCM data without DAC/ADC?
I mean, just like wireshark or tcpdump tool, is there some sort of alsadump that I can make use of?
I want to do bit-exact comparison of the output PCM data to make sure the audio processing algorithm (which is an executable binary) worked correctly.
Thanks a lot.

How to debug a Linux I2S audio input issue

I am trying, and failing, to connect an I2S microphone (Invensense ICS43432) to my Raspberry Pi (B+) running Arch Linux. I have asked for specific advice in the relevant Arch Linux ARM forum but my question is really more general than that: how does one go about debugging Linux audio input issues?
I have verified with a logic analyser that the I2S microphone is sending sensible data in the correct channel (left) and the correct pin of the Raspberry Pi. The I2S microphone appears under ALSA as a "sound card". arecord is perfectly happy to record from that device and I have boosted the gain of that device using alsamixer by 30 dB. Yet all the data bytes of the recorded file are zero.
How does one go about checking the flow of audio data, the operation of DMA, under Linux?
I had the same problem trying to record in stereo, using 2 Adafruit I2S MEMS breakout mics: arecord worked fine, but zeros when using ALSA to write to a bin file. Choosing a 32 bit word format (Little Endian 32 bits, Signed) made it work. Only I end up with 64 bit stereo Frames.

How to read video file using v4l2

I want to read a video file using v4l2, say an AVI file. And read it frame by frame.
As far as I can tell I need to use the read() function. But how isn't very clear to me. There are also hardly any examples available. So maybe a simple example on how to do this would help.
This is not what the Video4Linux2 (V4L2) API is for. It is not designed for reading multimedia files from disk, decoding them and playing them. Rather, it is designed to interface to assorted multimedia input devices (like webcams, microphones, TV tuners, and video capture devices), capture A/V data, and play it.
Take it from the V4L2 API introduction:
Video For Linux Two is [...] a kernel interface for analog radio and
video capture and output drivers.
For reading an AVI file and decoding/playing it (programmatically) on Linux, look into FFmpeg or GStreamer.

Resources