in reply to Re: Tk Morse Code Ear tutor (updated) -- oneliner
in thread Tk Morse Code Ear tutor

Hi again Discipulus, I have found the correct alternative, its called Audio::PortAudio, but there still seems to be glitches getting it to run under the widely used PulseAudio system. I think my simple pipe to aplay is the easiest thing to do. If anyone can show a Audio::PortAudio script that works with the PulseAudio system, I would be grateful to see it posted. PortAudio c programs seems to work fine.

UPDATE... duh.... I answered my own question. :-)

#!/usr/bin/perl use warnings; use strict; use Audio::PortAudio; my $api = Audio::PortAudio::default_host_api(); my $device = $api->default_output_device; my $pi = 3.14159265358979323846; my $sine = pack "f*", map { sin( $pi * $_ / 100 ) / 8 } 0 .. 399; my $stream = $device->open_write_stream( { channel_count => 1, }, 44100, 400, 0 ); for (0 .. 10) { $stream->write($sine); }

I'm not really a human, but I play one on earth. ..... an animated JAPH