diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2023-07-26 19:51:33 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2023-07-26 19:51:33 +1200 |
commit | 6a4fd86a07ebe97c8067e0e732efc2f708a2c6a8 (patch) | |
tree | 67e44274d89448305c3b54c204789a3e0aae0382 /example | |
parent | a9eb2fc7099b78287faf5765e6b9721ce4e93fc1 (diff) |
Changed data buffer types for easier interop with other libraries
Diffstat (limited to 'example')
-rw-r--r-- | example/saw_back.adb | 5 | ||||
-rw-r--r-- | example/sine_block.adb | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/example/saw_back.adb b/example/saw_back.adb index 680a7a2..89f075d 100644 --- a/example/saw_back.adb +++ b/example/saw_back.adb @@ -7,17 +7,18 @@ with Ada.Text_IO, + Interfaces, Portaudio.Streams; use type - Portaudio.Streams.Float_32; + Interfaces.IEEE_Float_32; procedure Saw_Back is - Left_Phase, Right_Phase : Portaudio.Streams.Float_32 := 0.0; + Left_Phase, Right_Phase : Interfaces.IEEE_Float_32 := 0.0; function Saw_Callback diff --git a/example/sine_block.adb b/example/sine_block.adb index 52c46fe..5ff5be5 100644 --- a/example/sine_block.adb +++ b/example/sine_block.adb @@ -8,6 +8,7 @@ with Ada.Numerics.Long_Elementary_Functions, Ada.Text_IO, + Interfaces, Portaudio.Streams; @@ -30,7 +31,7 @@ procedure Sine_Block is Sample_Buffer : Pstm.Buffer := Pstm.Wrap (Sample_Array, Per_Buffer, Channels); type Table_Index is mod 200; - Sine_Table : array (Table_Index) of Pstm.Float_32; + Sine_Table : array (Table_Index) of Interfaces.IEEE_Float_32; Left_Phase, Right_Phase : Table_Index := 0; Left_Increment : Table_Index := 1; @@ -49,7 +50,7 @@ begin "Buffer Size =" & Pstm.Frame_Amount'Image (Per_Buffer)); for Index in Table_Index loop - Sine_Table (Index) := Pstm.Float_32 + Sine_Table (Index) := Interfaces.IEEE_Float_32 (Elem.Sin (Long_Float (Index) / Long_Float (Table_Index'Last_Valid) * Num.Pi * 2.0)); end loop; |