is it possible to play a part of an audio file in Java? I know the starting time and end time and I want to play the period in between.
Searched for it a little but got no answer.
is it possible to play a part of an audio file in Java? I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use Java Media Framwork (JMF). Take a look on this link to see simple example: http://www.dzone.com/snippets/java-example-very-simple
Then take a look on the API of Player:
http://docs.oracle.com/cd/E17802_01/j2se/javase/technologies/desktop/media/jmf/2.1.1/apidocs/javax/media/Player.html
It has method
addController(). One of avaliable controllers is Clock:http://docs.oracle.com/cd/E17802_01/j2se/javase/technologies/desktop/media/jmf/2.1.1/apidocs/j
avax/media/Clock.html#setMediaTime(javax.media.Time)
It has methods
setMediaTime()andsetStopTime()that you need.