ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
hello, i need to produce sounds in Linux directly from a program, not using files (the program i want needs to generate sound based on various input ... so it can simulate say a hum) ..... i been looking around, but i cant find any info on what these sine / other waves do .... i understand the samples, sample rate, and stuff. but i cant find info on how to convert the numbers from a function into sound
do i take the numbers and change it endness to match the sound card? .... and what do things like "low pass" / "high pass" mean?
also i want to Analise the sound (split it up, similar to equalizers) .... is there any good tutorials on sound generation that i haven't found (i been searching real long, and the best i can find is "what sound waves are" , "examples of sound functions" (various number generating functions) and "how sound is represented in a computer" ... but nothing on the steps involved in generating or manipulating tones
anyone know where to find some good info i can use? (i plan to use SDL for audio i think)
Writing data to /dev/dsp will play sound. Reading data from /dev/dsp will give you data from the capturing device (line-in / microphone, etc).
If you want to change sample-rate, sample-size, etc. a simple ioctl() call can do that, but you'll have to look up the syntax online. You WILL need the proper permissions to use /dev/dsp, so set that up beforehand.
In addition to what zhangmaike said, low pass and high pass refer to filters. low pass filters allow low-frequency tones to pass through the filter, and high pass ones let high-frequency tones through.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.