Generating a sine wave with ALSA

11 messages Options
Generating a sine wave with ALSA – Hello, in my eternal struggle with ALSA :-) I was trying to convert in gambas a C code, written to generate a sine wave with ALSA functions....
Where is the C source? Without it I can't say whether you have translated it correctly or not. Jussi On Tue, Dec 17, 2013 at 6:38 PM, Ru ...
Oh, apparently I didn't read it through... Jussi On Tue, Dec 17, 2013 at 11:26 PM, Jussi Lahtinen <jussi.lahtinen@...>wrote: >...
The C code is in Data folder of Gambas project. Anyway, I've attached it to this email. Bye vuotttttttt ----------------------------...
At least this isn't right: Private Const SND_PCM_FORMAT_FLOAT As Integer = 14 I'll look more closely later. Jussi On Tue, Dec 17, 2013...
Uhmmmm... it would seem to be correct. In fact, if I insert this line in the code C: printf("SND_PCM_FORMAT_FLOAT value = %d", S...
No, as the name suggest it's float, not integer. Jussi On Wed, Dec 18, 2013 at 12:03 AM, Ru Vuott <vuott@...> wrote: > Uhmmmm....
I suppose it's a kind of signal, meaning.... ..you can see snd_pcm_writei() gives to ALSA handle a buffer variable full of Float values. vuo...
Also this was wrongly declared (correct below): ' snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)...
Also 14 is wrong, according to documentation, correct values are between -1 to 1. Jussi On Wed, Dec 18, 2013 at 1:20 AM, Ru Vuott <vuo...
"snd_pcm_t" is synonymous for "struct _snd_pcm" (typedef struct _snd_pcm snd_pcm_t;). And struct _snd_pcm is declared as.....