i have to write an application that convert text to voice for non English language
the problem that i face is that when trying to play the next one no delay is introduce so that many sound appear at the same time
here is my code for playing one wav sound
Code:InputStream is; Player player; try { is = getClass().getResourceAsStream("media/ss.wav"); player = Manager.createPlayer(is, "audio/X-wav"); player.realize(); // get volume control for player and set volume to max VolumeControl vc = (VolumeControl) player.getControl("VolumeControl"); if (vc != null) { vc.setLevel(100); } player.prefetch(); player.start(); } catch (Exception e) { }
the question is how to play multiple sound but the next one must not start if the previous not finished yet ???

Reply With Quote

