Package javax.sound.sampled

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


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

    }
}
View Full Code Here


                    } catch (IOException e) {
                        log.error(
                            "IO-Error while write auline for " + fileName, e);
                        return;
                    } finally {
                        auline.drain();
                        auline.close();
                    }

                }
            });
View Full Code Here

    }
    } catch (LineUnavailableException e) {
      //no-op
    } finally {
      if (sdl != null) {
        sdl.drain();
        sdl.stop();
        sdl.close();
      }
    }
  }
View Full Code Here

            while ((bytesRead = ais.read(data,0,data.length)) != -1) {
                line.write(data,0,bytesRead);
            }

            line.drain();
            line.stop();
            line.close();
        } catch (Exception e) {
            System.out.println(e);
        }
View Full Code Here

                        temp[3] = buf[512 + i * 2 + 1];
                        line.write(temp, 0, 4);
                    }
                }
            }
            line.drain();
            line.stop();
            line.close();
if (os != null) {
os.flush();
os.close();
View Full Code Here

            line.write(buf, 0, l);
if (os != null) {
os.write(buf, 0, l);
}
        }
        line.drain();
        line.stop();
        line.close();
if (os != null) {
os.close();
}
View Full Code Here

            line.write(buf, 0, l);
if (os != null) {
os.write(buf, 0, l);
}
        }
        line.drain();
        line.stop();
        line.close();
if (os != null) {
os.close();
}
View Full Code Here

        while (is.available() > 0) {
            l = is.read(buf, 0, 1024);
            line.write(buf, 0, l);
//  os.write(buf, 0, l);
        }
        line.drain();
        line.stop();
        line.close();
//  os.close();
    }
}
View Full Code Here

            }
        } catch (final IOException e) {
            o.failure(audioInputStream, e, "playsound:read", "Error getting sound data.");
            return;
        } finally {
            auline.drain();
            auline.close();
        }
    }
   
   
View Full Code Here

              nBytesWritten = 0;
            }
          }
        }

        line.drain();
        line.close();
      }
      catch (Exception e)
      {
        e.printStackTrace();
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.