Hi,
I'm trying to play a five second wav on a Nokia 7650 - when the code below tries playing the wav, the app closes and an error message is displayed with:
App. closed
jes-1f1-javax.microedition.lcdui0@1...
CMdaAudioPlayerU 2
/* code start */
try{
InputStream tune = this.getClass().getResourceAsStream("/resources/sound/4.wav"
byte[] bytes = new byte[50000];
tune.read(bytes,0,bytes.length);
Sound talk_S=new Sound(bytes,Sound.FORMAT_WAV);
talk_S.init(bytes,Sound.FORMAT_WAV);
talk_S.setGain(40);
talk_S.setSoundListener(this);
talk_S.play(1);
}
catch(Exception e){
osText p4_item_ex = new osText(debugNo + " "
thisPageItems.addElement(p4_item_ex);
osText p4_item_ex2 = new osText(e.toString());
thisPageItems.addElement(p4_item_ex2);
}
/* code end */
If I remove the line
talk_S.setGain(40);
No error is reported but equally no sound plays.
Any suggestions?
Mal

;
Reply With Quote

