PDA

View Full Version : روش الحاق دو فایل صوتی بهم



seyed_farid
چهارشنبه 06 اردیبهشت 1385, 15:56 عصر
من می خواهم دو فایل صوتی با فرمت WAV را به هم الحاق یا وصل کنم و از آن دو یک فایل بسازم. در این مورد کسی میتونه کمکی کنه؟

seyed_farid
شنبه 09 اردیبهشت 1385, 14:43 عصر
کسی در این مورد اطلاعی نداره؟
لازمش دارم.

hgkhatir
شنبه 09 اردیبهشت 1385, 15:44 عصر
از برنامه nero استفاده کند. nero wave editor

seyed_farid
شنبه 09 اردیبهشت 1385, 22:09 عصر
این برنامه رو از کجا گیر بیارم و آیا سورس دلفی داره؟

seyed_farid
دوشنبه 11 اردیبهشت 1385, 18:22 عصر
کسی این کار رو تا به حال انجام نداده؟
یه جواب بدید . ولش نکنید. مهمه:گریه: :گریه: :گریه:
:گیج: :kaf: :گیج:

seyed_farid
شنبه 16 اردیبهشت 1385, 23:31 عصر
با با جواب بدید اگه میدونید:تشویق: :تشویق: :تشویق:

seyed_farid
شنبه 23 اردیبهشت 1385, 22:28 عصر
من این کد را پیدا کردم اما فایل خروجی فقط فایل اول را پخش میکند و جالب اینکه حجم آن به اندازه دو فایل الحاق شده می باشد. کسی میدونه اشکال کار کجاست؟


PROCEDURE JoinFiles(File1, File2, EndResult : String);
var
F1, F2, R : TMemoryStream;
Begin
// This code was used for something else I was working on
// and does not directly apply to what you need but it
// should work "as-is" to join wav files together also.
// Actually, should work with any files, including EXEs...
//
// Just do some checks to see if files exists
if FileExists(File1) = false then
Begin
MessageDlg('File specified as File1 does not exist!',
mtInformation, [mbok],0);
End;
if FileExists(File2) = false then
Begin
MessageDlg('File specified as File2 does not exist!',
mtInformation, [mbOk],0);
End;
if FileExists(EndResult) = true then
Begin
MessageDlg('File specified for end result exists, will' +
' overwrite!', mtWarning, [mbok],0);
End;
// This is the code you will probably be interested in
// We are loading each file into a MemoryStream and
// joining them both together, then saving the output
// to another memory stream and then to a file. If you
// wish you can use TFileStream or TStream with very little
// modification. My method suites for small(ish) files. If
// you use it on very large files on systems with low memory
// then you can run into problems because TMemoryStream will
// store the files in memory only, wherease TFileStream and
// TStream wont need to load it all into memory at once.

// First create the 3 streams
F1 := TMemoryStream.Create; // first file
F2 := TMemoryStream.Create; // second file
R := TMemoryStream.Create; // end result of both files
// Now load the first two files into F1 and F2
F1.LoadFromFile(File1);
F2.LoadFromFile(File2);
// Now copy F1 and F2 into R
R.CopyFrom(File1, File1.Size);
// Reset position in R to the end of R so we can copy
// F2 stream to the end of it
R.Position := R.Size;
R.CopyFrom(F2, F2.Size);
// Free resources not needed
F1.Free;
F2.Free;
// Save R to disk, R is the result of the two files
R.SaveToFile(EndResult);
R.Free;
End;

realman
یک شنبه 24 اردیبهشت 1385, 07:39 صبح
PROCEDURE JoinFiles(File1, File2, EndResult : String);
var
F1, F2, R : TMemoryStream;
Begin
// This code was used for something else I was working on
// and does not directly apply to what you need but it
// should work "as-is" to join wav files together also.
// Actually, should work with any files, including EXEs...
//
// Just do some checks to see if files exists
if FileExists(File1) = false then
Begin
MessageDlg('File specified as File1 does not exist!',
mtInformation, [mbok],0);
End;
if FileExists(File2) = false then
Begin
MessageDlg('File specified as File2 does not exist!',
mtInformation, [mbOk],0);
End;
if FileExists(EndResult) = true then
Begin
MessageDlg('File specified for end result exists, will' +
' overwrite!', mtWarning, [mbok],0);
End;
// This is the code you will probably be interested in
// We are loading each file into a MemoryStream and
// joining them both together, then saving the output
// to another memory stream and then to a file. If you
// wish you can use TFileStream or TStream with very little
// modification. My method suites for small(ish) files. If
// you use it on very large files on systems with low memory
// then you can run into problems because TMemoryStream will
// store the files in memory only, wherease TFileStream and
// TStream wont need to load it all into memory at once.

// First create the 3 streams
F1 := TMemoryStream.Create; // first file
F2 := TMemoryStream.Create; // second file
R := TMemoryStream.Create; // end result of both files
// Now load the first two files into F1 and F2
F1.LoadFromFile(File1);
F2.LoadFromFile(File2);
// Now copy F1 and F2 into R
R.CopyFrom(File1, File1.Size);
// Reset position in R to the end of R so we can copy
// F2 stream to the end of it
R.Position := R.Size;
R.CopyFrom(F2, F2.Size);
// Free resources not needed
F1.Free;
F2.Free;
// Save R to disk, R is the result of the two files
R.SaveToFile(EndResult);
R.Free;
End;

seyed_farid
دوشنبه 25 اردیبهشت 1385, 18:31 عصر
ببخشید. اضافاتش رو زدم کد اینه ولی همون ایرادی که گفتم وجود داره



Procedure JoinFiles(File1, File2, EndResult : String);
var
F1, F2, R : TMemoryStream;
Begin
F1 := TMemoryStream.Create;
F2 := TMemoryStream.Create;
R := TMemoryStream.Create;
F1.LoadFromFile(File1);
F2.LoadFromFile(File2);
R.CopyFrom(F1, F1.Size);
R.Position := R.Size;
R.CopyFrom(F2, F2.Size);
F1.Free;
F2.Free;
R.SaveToFile(EndResult);
R.Free;
End;

:گریه: :گریه: :گریه:
:تشویق: :تشویق: :تشویق:

B_YAGHOBI
سه شنبه 26 اردیبهشت 1385, 07:20 صبح
یک ActiveX هست به اسم NCTAudioEditor کلا برای کار با ویرایش صدا میباشد

http://www.nctsoft.com/products/NCTAudioEditor2/

seyed_farid
سه شنبه 26 اردیبهشت 1385, 12:04 عصر
ظاهرا برای دلفی نیست.

B_YAGHOBI
چهارشنبه 27 اردیبهشت 1385, 06:34 صبح
از دستورات API ویندوز قسمت VFW توابعی برای ساخت و کپی فایلهای AVI, wave وجود دارد

seyed_farid
چهارشنبه 27 اردیبهشت 1385, 22:20 عصر
دوست عزیز میشه بیشتر توضیح بدبد:تشویق: :تشویق: :تشویق:

B_YAGHOBI
جمعه 29 اردیبهشت 1385, 11:38 صبح
شما دو فایل صوتی خود را با توابع AviFileOpen باز کنید

سپس یک فایل سومی بشکل AviFileOpen(AVIFileOUT, PChar(FileName) , OF_CREATE or OF_WRITE , nil)

ساخته و از دو فایل بالا با دستور AVIStreamRead خوانده و در سومی بریزید.

seyed_farid
جمعه 29 اردیبهشت 1385, 21:19 عصر
برای AviFileOpen در بخش Uses باید چیزی اضافه کنم؟ روی این دستور خطا میده.

B_YAGHOBI
شنبه 30 اردیبهشت 1385, 06:44 صبح
باید یونیت VFW را uses کنید :

seyed_farid
پنج شنبه 04 خرداد 1385, 13:12 عصر
دوست عزیز میشه لطف کنید دستوراتش رو مرقوم بفرمائید؟ من نتونستم ازش استفاده کنم.