[Gambas-user] Generating a sine wave with ALSA

Jussi Lahtinen jussi.lahtinen at ...626...
Wed Dec 18 00:21:07 CET 2013


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)
Private Extern snd_pcm_writei(pcm As Pointer, buffF As Pointer, sizeI As
Integer) As Integer

Perhaps the biggest problem is that you give null pointer, not pointer to
snd_pcm_t.


Jussi



On Wed, Dec 18, 2013 at 1:05 AM, Jussi Lahtinen <jussi.lahtinen at ...626...>wrote:

> No, as the name suggest it's float, not integer.
>
> Jussi
>
>
> On Wed, Dec 18, 2013 at 12:03 AM, Ru Vuott <vuott at ...325...> wrote:
>
>> 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", SND_PCM_FORMAT_FLOAT);
>>
>> and then I run that compilated C code, I obtain in terminal this results:
>>
>>      SND_PCM_FORMAT_FLOAT value =  14
>>
>>
>> In addition, you can easily calculate the enumeration of that ALSA
>> Constant in this page (see at Enumerations):
>>
>>   http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html
>>
>> You can see:  SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE
>>
>>
>> Thank you for your  help.
>>
>> bye
>> vuott
>>
>>
>>
>> --------------------------------------------
>> Mar 17/12/13, Jussi Lahtinen <jussi.lahtinen at ...626...> ha scritto:
>>
>>  Oggetto: Re: [Gambas-user] Generating a sine wave with ALSA
>>  A: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
>>  Data: Martedì 17 dicembre 2013, 22:34
>>
>>  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 at 11:31 PM, Ru Vuott <vuott at ...325...>
>>  wrote:
>>
>>  > The C code is in Data folder of Gambas project.
>>  >
>>  > Anyway, I've attached it to this email.
>>  >
>>  > Bye
>>  > vuotttttttt
>>  >
>>  >
>>  >
>>  > --------------------------------------------
>>  > Mar 17/12/13, Jussi Lahtinen <jussi.lahtinen at ...626...>
>>  ha scritto:
>>  >
>>  >  Oggetto: Re: [Gambas-user] Generating a sine wave
>>  with ALSA
>>  >  A: "mailing list for gambas users" <gambas-user at lists.sourceforge.net
>> >
>>  >  Data: Martedì 17 dicembre 2013, 22:26
>>  >
>>  >  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 Vuott <vuott at ...325...>
>>  >  wrote:
>>  >
>>  >  > 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.
>>  >  >
>>  >  > When I run the application, I can hear the
>>  sound of the
>>  >  wave, but it is
>>  >  > mixed with a background hiss.
>>  >  >
>>  >  > I would like to have your opinion and check
>>  if I have
>>  >  made good the
>>  >  > conversion.
>>  >  >
>>  >  > Attached:
>>  >  > - The Gambas source (in the Data folder is
>>  the original
>>  >  C code);
>>  >  > - The compiled C program that works
>>  perfectly ... As I
>>  >  would like with
>>  >  > Gambas!  :-(
>>  >  >
>>  >  > regards and thanks
>>  >  > vuott
>>  >  >
>>  >  >
>>  >
>>  >
>>
>>  ------------------------------------------------------------------------------
>>  >  > Rapidly troubleshoot problems before they
>>  affect your
>>  >  business. Most IT
>>  >  > organizations don't have a clear picture of
>>  how
>>  >  application performance
>>  >  > affects their revenue. With AppDynamics, you
>>  get 100%
>>  >  visibility into your
>>  >  > Java,.NET, & PHP application. Start your
>>  15-day
>>  >  FREE TRIAL of AppDynamics
>>  >  > Pro!
>>  >  >
>>  >
>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>>  >  >
>>  _______________________________________________
>>  >  > Gambas-user mailing list
>>  >  > Gambas-user at lists.sourceforge.net
>>  >  > https://lists.sourceforge.net/lists/listinfo/gambas-user
>>  >  >
>>  >  >
>>  >
>>  >
>>
>>  ------------------------------------------------------------------------------
>>  >  Rapidly troubleshoot problems before they affect
>>  your
>>  >  business. Most IT
>>  >  organizations don't have a clear picture of how
>>  application
>>  >  performance
>>  >  affects their revenue. With AppDynamics, you get
>>  100%
>>  >  visibility into your
>>  >  Java,.NET, & PHP application. Start your
>>  15-day FREE
>>  >  TRIAL of AppDynamics Pro!
>>  >
>>  >
>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>>  >  _______________________________________________
>>  >  Gambas-user mailing list
>>  >  Gambas-user at lists.sourceforge.net
>>  >  https://lists.sourceforge.net/lists/listinfo/gambas-user
>>  >
>>  >
>>  >
>>
>>  ------------------------------------------------------------------------------
>>  > Rapidly troubleshoot problems before they affect your
>>  business. Most IT
>>  > organizations don't have a clear picture of how
>>  application performance
>>  > affects their revenue. With AppDynamics, you get 100%
>>  visibility into your
>>  > Java,.NET, & PHP application. Start your 15-day
>>  FREE TRIAL of AppDynamics
>>  > Pro!
>>  >
>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>>  > _______________________________________________
>>  > Gambas-user mailing list
>>  > Gambas-user at lists.sourceforge.net
>>  > https://lists.sourceforge.net/lists/listinfo/gambas-user
>>  >
>>  >
>>
>>  ------------------------------------------------------------------------------
>>  Rapidly troubleshoot problems before they affect your
>>  business. Most IT
>>  organizations don't have a clear picture of how application
>>  performance
>>  affects their revenue. With AppDynamics, you get 100%
>>  visibility into your
>>  Java,.NET, & PHP application. Start your 15-day FREE
>>  TRIAL of AppDynamics Pro!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>>  _______________________________________________
>>  Gambas-user mailing list
>>  Gambas-user at lists.sourceforge.net
>>  https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Rapidly troubleshoot problems before they affect your business. Most IT
>> organizations don't have a clear picture of how application performance
>> affects their revenue. With AppDynamics, you get 100% visibility into your
>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
>> Pro!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
>



More information about the User mailing list