Hi Everyone!!
I would kindly like some help to be able to stop, forward and rewind the the wav file when pressing the respective buttons for it. n i would like to do that by 1st determining the current byte the sound that was played when button was pressed and then forwarding it or rewinding it based on that byte. The help is very much appreciated. Here is some of my code:-

Server Side- To Establish Connection :-

Java Code:
try{  
  
            welcomeSocket = new ServerSocket(4563);  
  
            while (true) {  
  
            clientSocket = welcomeSocket.accept();  
  
                 inFromClient1 =  
                        new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));  
  
                 outToClient =  
                        new DataOutputStream(clientSocket.getOutputStream());
Client Side- To Receive Connection and list of file names:-


Java Code:
try{  
  
            clientSocket = new Socket("localhost",4563);  
            outToServer =  
                    new DataOutputStream(clientSocket.getOutputStream());  
             inFromServer =  
                    new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));  
  
  
            outToServer.writeBytes(user + '\n');  
            outToServer.writeBytes(str.toString()+'\n');  
            //outToServer.writeBytes(str);  
  
  
            String fileNames[] = new String[20];  
  
            int count = (inFromServer.read());  
            for (int i = 0; i<count; i++)  
                fileNames[i] = inFromServer.readLine();  
            jList1.setListData(fileNames);  
            jList1.updateUI();  
  
            // clientSocket.close();  
  
        } catch (IOException e) {  
            System.err.println("Can not Connect");}
Client Side- To send selected file name to be played from Server upon play button is pressed.

Java Code:
try{  
            outToServer.write(jList1.getSelectedIndex());  
            playAudio();  
        } catch (IOException e) {  
            System.err.println("Error");}
Server Side- To send sound file.


Java Code:
class StreamThread extends Thread{  
  byte b[] = new byte[100];  
  
  
  
  public void run(){     
      
    {  
                try {  
                      outToClient.write(count);  
                      for (int i = 0 ; i >< count; i++)  
                      outToClient.writeBytes(fileName[i]+'\n');  
                      int cf = inFromClient1.read();  
                      System.out.println(cf);  
                        
                          FileInputStream fis = new FileInputStream(files[cf]);  
  
                         // byte[] b = new byte [100];  
                          int r = fis.read(b, 0, b.length);  
                          while( r != -1) {  
                              outToClient.write(b, 0, r);  
                              r = fis.read(b,0, b.length);  
                          }  
                          System.out.println("Streaming finished");  
                      }  
  
                catch(IOException e) {  
                          System.err.println(e);  
                          System.exit(1);  
                      }  
                      
    }  
  }  
}
Client Side - To play file.


Java Code:
private void playAudio() {  
  
  
    try{  
  
  
      audioInputStream = AudioSystem.getAudioInputStream(clientSocket.getInputStream());  
      audioFormat = audioInputStream.getFormat();  
      System.out.println(audioFormat);  
  
      DataLine.Info dataLineInfo =  
                          new DataLine.Info(  
                            SourceDataLine.class,  
                                    audioFormat);  
  
      sourceDataLine =  
             (SourceDataLine)AudioSystem.getLine(  
                                   dataLineInfo);  
  
      //Create a thread to play back the data and  
      // start it running.  It will run until the  
      // end of file, or the Stop button is  
      // clicked, whichever occurs first.  
      // Because of the data buffers involved,  
      // there will normally be a delay between  
      // the click on the Stop button and the  
      // actual termination of playback.  
      new PlayThread().start();  
    }catch (Exception e) {  
      e.printStackTrace();  
      System.exit(0);  
    }//end catch  
}//end playAudio  
  
class PlayThread extends Thread{  
  byte tempBuffer[] = new byte[100];  
  
  public void run(){  
  
   try{  
      sourceDataLine.open(audioFormat);  
      sourceDataLine.start();  
      int buffcount;  
      int cnt;  
      //Keep looping until the input read method  
      // returns -1 for empty stream or the  
      // user clicks the Stop button causing  
      // stopPlayback to switch from false to  
      // true.  
      while((cnt = audioInputStream.read(  
           tempBuffer,0,tempBuffer.length)) != -1  
                       && stopPlayback == false){  
        if(cnt > 0){  
  
          //Write data to the internal buffer of  
          // the data line where it will be  
          // delivered to the speaker.  
          sourceDataLine.write(  
                             tempBuffer, 0, cnt);  
            
  
        }   
        else if(stopPlayback = true)  
        {  
            cnt= audioInputStream.read(  
           tempBuffer);  
             
           outToServer.writeByte(cnt);  
        }  
        else if(forwardPlayback = true)  
        {  
             cnt = audioInputStream.read(  
           tempBuffer);  
             outToServer.writeByte(cnt);  
        }  
        else if(rewindPlayback = true)  
        {  
            cnt= audioInputStream.read(  
           tempBuffer);  
            outToServer.writeByte(cnt);  
        }  
  
      }//end while  
      //Block and wait for internal buffer of the  
      // data line to empty.  
      sourceDataLine.drain();  
      sourceDataLine.close();  
  
      //Prepare to playback another file  
      jButton3.setEnabled(false);  
      jButton2.setEnabled(true);  
      stopPlayback = false;  
    }catch (Exception e) {  
      e.printStackTrace();  
      System.exit(0);  
    }//end catch  
  }  //end run
Thank You.