AudioInputStream, can byte[] be converted to audioOutputStream
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mehreen_afzal
Posted On:   Thursday, September 19, 2002 08:35 AM

a part of my code is: try { audioInputStream = AudioSystem.getAudioInputStream(soundFile); blocksNum = audioInputStream.available(); } catch (Exception em) { em.printStackTrace(); System.exit(1); } byte dataByte[] = new byte[blocksNum]; byte outputDataByte[] = new byte[blocksNum]; try{ int g=audioInputStream.read(dataByte); }catch(Exception nw){System.out.println("audioInputStream");} blocksNum = blocksNum -(blocksNum%8); int temp = 0; for(blocksNuu=0;blocksNuu { encipherment(); for(int k=0 ; k <8 ;k++) outputDataByte[k+temp]= (byte) letter[k]; temp+=   More>>

a part of my code is:


try
{
audioInputStream = AudioSystem.getAudioInputStream(soundFile);
blocksNum = audioInputStream.available();
}
catch (Exception em)
{
em.printStackTrace();
System.exit(1);
}
byte dataByte[] = new byte[blocksNum];
byte outputDataByte[] = new byte[blocksNum];
try{
int g=audioInputStream.read(dataByte);
}catch(Exception nw){System.out.println("audioInputStream");}

blocksNum = blocksNum -(blocksNum%8);
int temp = 0;
for(blocksNuu=0;blocksNuu
{
encipherment();
for(int k=0 ; k <8 ;k++)
outputDataByte[k+temp]= (byte) letter[k];
temp+=8;


}




now can this outputDataByte[] which is a byte[] array be converted to audioOutputStream so that it can be written and then read as audio file(.wav format)    <<Less
About | Sitemap | Contact