From: The Natural Philosopher on
pk wrote:
> The Natural Philosopher wrote:
>
>> For a debian linux system.
>>
>> I don't want the syntesizer bit..can take care of all that..just how to
>> hook C or indeed any other language into making a noise come out of the
>> speakers.
>>
>> Ideally would be a fragment of code that simply makes any noise on my
>> ALSA based sound system.
>>
>> The only bit I found segfaults when it opens device 'default'
>
> How about
>
> anything_that_produces_some_output > /dev/dsp
>
> (the noise that comes out of it is not very pretty though)

cat > /dev/dsp
-bash: /dev/dsp: Device or resource busy

:-(
From: pk on
The Natural Philosopher wrote:

> pk wrote:
>> The Natural Philosopher wrote:
>>
>>> For a debian linux system.
>>>
>>> I don't want the syntesizer bit..can take care of all that..just how to
>>> hook C or indeed any other language into making a noise come out of the
>>> speakers.
>>>
>>> Ideally would be a fragment of code that simply makes any noise on my
>>> ALSA based sound system.
>>>
>>> The only bit I found segfaults when it opens device 'default'
>>
>> How about
>>
>> anything_that_produces_some_output > /dev/dsp
>>
>> (the noise that comes out of it is not very pretty though)
>
> OK, can you ( haha ) AMPLIFY on that a little?
>
>
> If I feed a bunch of bytes to that, are they simply buffered and spat
> out as a sequence of binary audio levels at 44Khz?
>
> If so, its just what I need.

Not sure about the 44Khz part, but yeah, it just takes whatever you throw at
it as if it were something to play.

About the "device or resource busy" thing, not sure, but it might be that
the device is being used exclusively by some process in the system
(typically things like arts, or gstreamer I think). At least I seem to
remember I had some similar problem in the past, although unfortunately I
can't really help you more.
From: Allodoxaphobia on
On Thu, 24 Dec 2009 16:49:31 +0000, The Natural Philosopher wrote:
> despen(a)verizon.net wrote:
>> The Natural Philosopher <tnp(a)invalid.invalid> writes:
>>
>>> For a debian linux system.
>>>
>>> I don't want the syntesizer bit..can take care of all that..just how
>>> to hook C or indeed any other language into making a noise come out of
>>> the speakers.
>>
>> For C:
>>
>> system("aplay sound.wav");
>>
>> similar facilities exist for most other languages.
>
> I dont have a wav.

I believe you do.
$ locate .wav

Jonesy
From: The Natural Philosopher on
Allodoxaphobia wrote:
> On Thu, 24 Dec 2009 16:49:31 +0000, The Natural Philosopher wrote:
>> despen(a)verizon.net wrote:
>>> The Natural Philosopher <tnp(a)invalid.invalid> writes:
>>>
>>>> For a debian linux system.
>>>>
>>>> I don't want the syntesizer bit..can take care of all that..just how
>>>> to hook C or indeed any other language into making a noise come out of
>>>> the speakers.
>>> For C:
>>>
>>> system("aplay sound.wav");
>>>
>>> similar facilities exist for most other languages.
>> I dont have a wav.
>
> I believe you do.
> $ locate .wav
>
> Jonesy

Oh get real. I want to MAKE sounds, not PLAY RECORDINGS.

OK?
From: unruh on
On 2009-12-24, pk <pk(a)pk.invalid> wrote:
> The Natural Philosopher wrote:
>
>> For a debian linux system.
>>
>> I don't want the syntesizer bit..can take care of all that..just how to
>> hook C or indeed any other language into making a noise come out of the
>> speakers.
>>
>> Ideally would be a fragment of code that simply makes any noise on my
>> ALSA based sound system.
>>
>> The only bit I found segfaults when it opens device 'default'
>
> How about
>
> anything_that_produces_some_output > /dev/dsp

/dev/dsp is not alsa, it is OSS ( or OSS emulation) There is lots of
documentation on how to interface with oss. With alsa there is virtually
no documentation at all. All I can suggest is to take theproblem aplay,
and read the source code for it. It is not trivial.

>
> (the noise that comes out of it is not very pretty though)