פורסם 2011 באוקטובר 1514 שנים שלום לכולם.מצאתי את הקטע קוד הזה (כמובן ששיניתי אותו לפי צרכי) :איך עושים שקובץ הסאונד לא התנגן בלופ?cimport javax.swing*;import sun.audio.*;import java.awt.event.*;import java.io.*;public class Sound { public static void music(){ AudioPlayer MGP = AudioPlayer.player; AudioStream BGM; AudioData MD; ContinuousAudioDataStream loop = null; try{ BGM = new AudioStream(new FileInputStream("c:\\eating.wav")); MD = BGM.getData(); loop = new ContinuousAudioDataStream(MD); }catch(IOException error){ System.out.print("file not found"); } MGP.start(loop); }}
פורסם 2011 באוקטובר 1514 שנים נסה את הקוד הזה:import sun.audio.*;public class Main { public static void main(String[] args) { PlaySound("123.wav"); } public static void PlaySound(String key){ try{ AudioPlayer.player.start(new AudioStream(new FileInputStream((key))));}catch(Exception e){}}}
ארכיון
דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.