Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9014851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:36:45+00:00 2026-06-16T03:36:45+00:00

I am implementing a mp3 player which is command line. I want show the

  • 0

I am implementing a mp3 player which is command line.

I want show the mp3 duration like this

Now Playing :: hello.mp3 Duration :: 1.20 

But when I use System.out.println it shows

Now Playing :: hello.mp3 Duration :: 1.20 
Now Playing :: hello.mp3 Duration :: 1.21 
Now Playing :: hello.mp3 Duration :: 1.22 
Now Playing :: hello.mp3 Duration :: 1.23 
Now Playing :: hello.mp3 Duration :: 1.24 
Now Playing :: hello.mp3 Duration :: 1.25
..... 

Basically the duration getting update by a thread, I want to show it a single line, I mean the duration have to be updated in single line. I have see the Flushable interface but didn’t get it. Please help me out

here is my thread

while(p.getPlayer().isComplete() == false){
String bOutput = "\r Duration ::" + (int) ((p.getPlayer().getPosition() / (1000*60)) % 60) + " : " + (int) (p.getPlayer().getPosition() / 1000) % 60;
//p.getBufferedOutputStream().write(bOutput.getBytes());
//p.getBufferedOutputStream().flush();
System.out.println(bOutput);

Thread.sleep(1000);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:36:46+00:00Added an answer on June 16, 2026 at 3:36 am
    while(p.getPlayer().isComplete() == false){
    String bOutput = "Duration ::" + (int) ((p.getPlayer().getPosition() / (1000*60)) % 60) + " : " + (int) (p.getPlayer().getPosition() / 1000) % 60;
    System.out.println(bOutput+"\r");
    
    Thread.sleep(1000);
    }
    

    This is solve my problem.

    Note: I don’t see any effect in Eclipse Console, When I run it on CMD then its works

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im implementing NFS and almoste done but the RFC section 3.3.8 says this in
implementing publishActivity in PHP using the REST API using this code: $activity = array(
When implementing the Strategy Pattern, where does one put the code that determines which
How do I prevent direct access/download to mp3/wav files while allowing a flash player
implementing service something similar with tinyurl or bit.ly, I'm would like to expose service
I am implementing an audio player in my app. and I have a UITableView
I'm implementing a game for WP7, and I need that a mp3 file plays
Implementing Kings' Corners (glorified multiplayer Solitaire) in Java. I'm trying to allow a player
Implementing/handling idempotency in c# with Jolivers EventStore. Does this mean just taking care of
I'm trying to write a program that will play MP3's. This program will also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.