diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2023-07-26 22:32:42 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2023-07-26 22:32:42 +1200 |
commit | a9a297e8f7282bcc9b3ffb14862160bb1abad511 (patch) | |
tree | a98e21194729781855a7844235994afe5cb91b98 /example/aao_example.adb | |
parent | 2a68b941e023a891df495ae6636fe3ae7c5e66b6 (diff) |
Changed data buffer type for better interop with other libraries
Diffstat (limited to 'example/aao_example.adb')
-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); |