summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/sine_block.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/example/sine_block.adb b/example/sine_block.adb
index b28b7cd..538d1d9 100644
--- a/example/sine_block.adb
+++ b/example/sine_block.adb
@@ -27,8 +27,9 @@ procedure Sine_Block is
Channels : constant Natural := 2;
Per_Buffer : constant Pstm.Frame_Amount := 1024;
- Sample_Array : aliased Pstm.Float_32_Array (1 .. Natural (Per_Buffer) * Channels) :=
- (others => 0.0);
+ -- Note how this array specifies the bounds in the initial value rather than the type.
+ -- This is important because otherwise the aliasing would cause subtype mismatch errors.
+ Sample_Array : aliased Pstm.Float_32_Array := (1 .. Natural (Per_Buffer) * Channels => 0.0);
Sample_Buffer : Pstm.Buffer := Pstm.Wrap (Sample_Array, Per_Buffer, Channels);
type Table_Index is mod 200;