0

I'd either like to export to file or play live sound frequencies. How?

The equivalent in C#

Console.Beep(1, 1);n//Beep 1Hz for 1ms
  • possible duplicate of [Writing musical notes to a wav file](http://stackoverflow.com/questions/4974531/writing-musical-notes-to-a-wav-file) – Greg Hewgill Apr 27 '14 at 23:21

1 Answers1

2

The Ada standard does not include a sound API, but there are libraries which can help you. Those that I know of:

  • ALSA binding - records and plays back sound on a Linux system
  • libao binding - sound library for ESD, OSS, Solaris, and IRIX.

If you really just need a plain beep on the console, this should work on all ANSI compatible consoles:

with Ada.Characters.Latin_1,
     Ada.Text_IO;

procedure Beep is
begin
   Ada.Text_IO.Put (Ada.Characters.Latin_1.BEL);
end Beep;
Jacob Sparre Andersen
  • 6,733
  • 17
  • 22