Eli,
> All four listings on that page work for me.
Thats strange to say the least: In the code I posted the link to I had to
initialize the "dir" variable (to zero) to get rid of an initial delay (in
the "snd_pcm_hw_params_set_rate_near( )" function). Compiler differences ?
(I'm using gcc)
Besides that, the code worked alright for me too. Up until I changed the
sample rate from 44100 to 8000 that is. Than the sound became much shorter.
> So I have to wonder if you've introduced a bug in your code
> changes which you have described but not shared.
I just re-started with the code I took from the link I posted, and changed
the "val = 44100;" line into
val = 8000;
dir = 0;
Thats all I need to get the (much) shorter sound.
And just now, after re-adding the code to measure the time from the start of
the loop until after "snd_pcm_drain()", I noticed that even with the
origional bitrate of 44100 the sound now only goes for 4.3 seconds ...
> You might have more luck in a more general Linux group
> (comp.os.linux.misc gets a fair amount of traffic) or a programming
> group (comp.lang.c is active). But include your actual code.
I have been thinking of that too, but I currently regard the problem as
being ALSA, and possibly Raspberry Pi specific, not one of the language
itself.
Regards,
Rudy Wieser
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|