OSDN Git Service

8bit 側の変更を完了 other
authoryamat0jp <yamat0jp@yahoo.co.jp>
Fri, 18 May 2018 09:24:03 +0000 (18:24 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Fri, 18 May 2018 09:24:03 +0000 (18:24 +0900)
effect.pas

index 3b9e699..17792d1 100644 (file)
@@ -24,9 +24,10 @@ begin
   result := 0;
   try
     s := TMemoryStream.Create;
-    s.ReadBuffer(sp.pWav^, sp.sizeOfData);
+    s.Write(sp.pWav^, sp.sizeOfData);
+    s.Position := 0;
+    s.Read(Pointer(pCpy)^,sp.sizeOfData);
     pMem := sp.pWav;
-    pCpy := s.Memory;
     i := sp.posOfData;
     k := 8 * sp.sizeOfData / sp.bitsPerSample;
     while i < k do
@@ -39,6 +40,8 @@ begin
   except
     result := -1;
   end;
+  s.Free;
+  Finalize(pCpy);
 end;
 
 function effect16BitWav(const sp: SpParam): integer;