sorry, I still can't get the bitrate out of WMA file

The place for "I can't figure out how to..." questions.

sorry, I still can't get the bitrate out of WMA file

Postby kenmaster » Sat May 20, 2006 9:24 pm

I use PHP code to get all the tags info out of WMA but bitrate.
Here's my code:

if ($wmafile) { // is it an WMA file?
$txt_artist = isset($mp3info['comments']['artist'][0]) ? $mp3info['comments']['artist'][0] : "";
$txt_song = isset($mp3info['comments']['title'][0]) ? $mp3info['comments']['title'][0] : "";
$txt_album = isset($mp3info['comments']['album'][0]) ? $mp3info['comments']['album'][0] : "";
$num_track = isset($mp3info['comments']['track'][0]) ? $mp3info['comments']['track'][0] : 0;
$num_year = isset($mp3info['comments']['year'][0]) ? $mp3info['comments']['year'][0] : 0;

// Try to get a valid ID3v1 genre ID
require ("includes\genres_array.inc.php");
$num_genre = isset($mp3info['comments']['genre'][0]) ? $mp3info['comments']['genre'][0] : 255;
if (array_search($num_genre,$genres_array) != NULL) {
$num_genre = array_search($num_genre,$genres_array); // $num_genre now contains the old ID3v1 tag
} else {
$num_genre=255;
$genre_error=1;
}

if (isset($mp3info['asf']['audio']['bitrate_mode']) || isset($mp3info['asf']['audio']['bitrate'])) {
if ($mp3info['asf']['audio']['bitrate_mode']=="CBR") {
$txt_quality=$mp3info['asf']['audio']['bitrate_mode'];
} else {
$txt_quality=$mp3info['asf']['video']['bitrate'];
}
} else $txt_quality = "unknown";
}

But I can't get the bitrate out of WMA file, could anyone help?
kenmaster
User
 
Posts: 4
Joined: Fri May 19, 2006 7:58 pm

Postby James Heinrich » Sat May 20, 2006 9:41 pm

Code: Select all
echo $mp3info['bitrate'];
James Heinrich
getID3() v1 developer
 
Posts: 1203
Joined: Fri May 04, 2001 11:00 am
Location: London, ON, Canada

Postby kenmaster » Sat May 20, 2006 9:51 pm

sorry, where did mean I should put this code in?
kenmaster
User
 
Posts: 4
Joined: Fri May 19, 2006 7:58 pm

Postby James Heinrich » Sat May 20, 2006 9:56 pm

Wherever you want. The overall file bitrate is stored in $mp3info['bitrate'] as a float. Do with it as you please.
James Heinrich
getID3() v1 developer
 
Posts: 1203
Joined: Fri May 04, 2001 11:00 am
Location: London, ON, Canada


Return to Support 1.x

Who is online

Users browsing this forum: No registered users and 1 guest

cron