Package javax.sound.sampled

Examples of javax.sound.sampled.SourceDataLine.drain()


                  total += numBytesRead;
                  line.write(myData, 0, numBytesRead);
                }
              }catch(Exception e) {}

              line.drain();
              line.stop();
            }
          }.start();

          return line;
View Full Code Here


         * by prematurely closing the line and exiting the VM.)
         *
         * Thanks to Margie Fitch for bringing me on the right path to this
         * solution.
         */
        line.drain();

        /*
         * All data are played. We can close the shop.
         */
        line.close();
View Full Code Here

      }
     
      // release all audio resources
      targetDataLine.drain();
      targetDataLine.close();
      sourceDataLine.drain();
      sourceDataLine.close();
    }
  }

}
View Full Code Here

            }
        } catch (final IOException e) {
            e.printStackTrace();
            return;
        } finally {
            auline.drain();
            auline.close();
        }

    }
}
View Full Code Here

          nBytesWritten = line.write(data, 0, nBytesRead);
        }

      }
      // Stop
      line.drain();
      line.stop();
      line.close();
      din.close();
    }
View Full Code Here

                }

            }

            // Stop
            line.drain();
            line.stop();
            line.close();
            din.close();
            //96515374
        }
View Full Code Here

      {
      nBytesRead = din.read(data, 0, data.length);
      if (nBytesRead != -1) nBytesWritten = line.write(data, 0, nBytesRead);
      }
      // Stop
      line.drain();
      line.stop();
      line.close();
      din.close();
    }   
  }
View Full Code Here

          {
            nBytesRead = din.read(data, 0, data.length);
            if (nBytesRead != -1) nBytesWritten = line.write(data, 0, nBytesRead);
          }
          // Stop
          line.drain();
          line.stop();
          line.close();
          din.close();
        }      
    }
View Full Code Here

        if (nBytesRead >= 0) {
          auline.write(abData, 0, nBytesRead);
        }
      }
     
      auline.drain();
     
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (auline != null) try { auline.close(); } catch (Exception e1) { }
View Full Code Here

      }
    } catch (IOException e) {
      e.printStackTrace();
      return;
    } finally {
      auline.drain();
      auline.close();
    }
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.