D
D
dlinyj2013-05-15 12:58:43
linux
dlinyj, 2013-05-15 12:58:43

Sound programming in C. API Search

I decided to return to the written article habrahabr.ru/post/133320/ about the random number generator from the sound card, and use it as a good “live” random number generator distributed according to the normal law (with all the artifacts that I need).

image
Signal Artifacts

On Ubuntu 12.04 , I decided to run this program, but faced the fact that the program cursed for the absence of /dev/dsp.

Attempts to install modules, packages did not lead to the appearance of this device in the system. And I realized that it is worth changing the approach to working with sound. It is necessary to work not with the device, but with the universal API.

Starting to pick on the topic, I went into the wilds of Google and realized that the old articles on sound programming were beaten, and new ones had not yet been written. Banned on Google... Nothing useful, especially in terms of sound capture.

Can you tell me a good example of a modern API for working with sound? I basically just get raw data from the microphone input, and then I'll eat them.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
silvansky, 2013-05-15
@dlinyj

I got around this by using sox.

E
Eddy_Em, 2013-05-15
@Eddy_Em

Search on stackexchange: I just saw a similar question today. Plus there are a lot more like it!
If you don't need wrappers, but "low-level" libraries, then this is either OSS4 (just the one that /dev/dsp creates), or ALSA. There are others, but they are either scored or they are inconvenient.
Under ALSA, programming low-level sound is a hemorrhoid. However, don't worry if you have ALSA but no OSS4: just load the snd_pcm_oss module to get ALSA OSS emulation. I did.
If you’re interested, I can send you my old program links somewhere (I once tried to use a sound box as an elementary ADC / DAC, but because I didn’t find a single very old sound box, and in the new ones everywhere the galvanic isolation on the ADC is “sewn ” into the chip, abandoned this matter). I also had sound generation from a simple picture (I started to make a test for a tip-tilt mirror, but also abandoned it).

A
Andrew, 2013-05-15
@xaoc80

ffmpeg is able to work with various audio sources. You can try its API

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question