diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/aao_example.adb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/example/aao_example.adb b/example/aao_example.adb index 6851f54..51466f8 100644 --- a/example/aao_example.adb +++ b/example/aao_example.adb @@ -11,6 +11,7 @@ with Ada.Command_Line, Ada.Numerics.Elementary_Functions, Ada.Text_IO, + Interfaces, Libao; @@ -74,10 +75,10 @@ begin Math.Sin (2.0 * Ada.Numerics.Pi * 440.0 * Float (I) / 44100.0)) mod 65536); -- Put the same stuff in left and right channel - Buffer (4 * I + 1) := Character'Val (Sample and 16#FF#); - Buffer (4 * I + 2) := Character'Val ((Sample / 256) and 16#FF#); - Buffer (4 * I + 3) := Character'Val (Sample and 16#FF#); - Buffer (4 * I + 4) := Character'Val ((Sample / 256) and 16#FF#); + Buffer (4 * I + 1) := Interfaces.Unsigned_8 (Sample and 16#FF#); + Buffer (4 * I + 2) := Interfaces.Unsigned_8 ((Sample / 256) and 16#FF#); + Buffer (4 * I + 3) := Interfaces.Unsigned_8 (Sample and 16#FF#); + Buffer (4 * I + 4) := Interfaces.Unsigned_8 ((Sample / 256) and 16#FF#); end loop; My_Device.Play (Buffer); |