From 6a4fd86a07ebe97c8067e0e732efc2f708a2c6a8 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 26 Jul 2023 19:51:33 +1200 Subject: Changed data buffer types for easier interop with other libraries --- example/saw_back.adb | 5 +++-- example/sine_block.adb | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'example') 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; -- cgit