Note that there are some explanatory texts on larger screens.

plurals
  1. POmp3 header information reader not working
    primarykey
    data
    text
    <p>hi all i get bit rate from the following code . i have a song with bit rate is 128kbps. but it print 0 only. please help me. code: import java.io.File; import java.io.IOException;</p> <pre><code> import org.farng.mp3.MP3File; import org.farng.mp3.TagException; import org.farng.mp3.id3.AbstractID3v1; import org.farng.mp3.id3.AbstractID3v2; public class ID3Reader { File sourcefile; MP3File mp3file; public ID3Reader(String filename) { sourcefile = new File(filename); try { mp3file = new MP3File(sourcefile); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (TagException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main( String[] args ) { ID3Reader id3reader = new ID3Reader("D:\\Mp3\\taxi.mp3"); id3reader.displayinformations(); } private void displayinformations() { String title="", artist="", album="", genre="", year=""; System.out.println("bit rate"+mp3file.getBitRate()); // print bit rate as 0(zero). if(mp3file.hasID3v1Tag()){ AbstractID3v1 tag = mp3file.getID3v1Tag(); if(tag != null){ try{ title = tag.getSongTitle(); }catch(Exception e){} try{ artist = tag.getLeadArtist(); }catch(Exception e){} try{ album = tag.getAlbumTitle(); }catch(Exception e){} try{ genre = tag.getSongGenre(); }catch(Exception e){} try{ year = tag.getYearReleased(); }catch(Exception e){} } }else if(mp3file.hasID3v2Tag()){ AbstractID3v2 tag = mp3file.getID3v2Tag(); if(tag != null){ title = tag.getFrame("TT2").toString(); artist = tag.getFrame("TP1").toString(); album = tag.getFrame("TAL").toString(); year = tag.getFrame("TYE").toString(); genre = tag.getFrame("TCO").toString(); } } System.out.println("Titre : " + title); System.out.println("Artiste : " + artist); System.out.println("Album : " + album); System.out.println("Genre : " + genre); System.out.println("Annee : " + year); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload