Frage

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
War es hilfreich?

Lösung

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;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top