السلام عليكــم ورحمـة الله وبركاتــه
اخواني أتمنى منكم مساعدتي في الحصول على برنامج بلغة الجافا عن كيفية دمج صوتين
وهذا جزء من الكود ممكن يساعدكمsond splice والمسمى
public void splice() {
Sound sound1 =
new Sound(FileChooser.getMediaPath("guzdial.wav"));
Sound sound2 =
new Sound(FileChooser.getMediaPath("is.wav"));
int targetIndex = 0; // the starting place on the target
int value = 0;
// copy all of sound 1 into the current sound (target)
for (int i = 0;
i < sound1.getLength();
i++, targetIndex++)
{
value = sound1.getSampleValueAt(i);
this.setSampleValueAt(targetIndex,value);
}
//create silence between words by setting values to 0
for (int i = 0;
i < (int) (this.getSamplingRate() * 0.1);
i++, targetIndex++)
{
this.setSampleValueAt(targetIndex,0);
}
http://' target="_blank">[Page 299] //copy all of sound 2 into the current sound (target)
for (int i = 0;
i < sound2.getLength();
i++, targetIndex++)
{
value = sound2.getSampleValueAt(i);
this.setSampleValueAt(targetIndex,value);
}
}
To test this we need a "blank" sound that the two sounds will be copied to. You can use the file "sec3silence.wav" for this. It holds 3 seconds of silence, which should be more than enough
