help with demo.basic.php

The place for "I can't figure out how to..." questions.
Post Reply
louis
User
Posts: 3
Joined: Fri Feb 02, 2007 2:14 am
Location: uk

help with demo.basic.php

Post by louis » Fri Feb 02, 2007 2:39 am

Hello, I'm a fair n00b at this and can't get the most basic functions to work.

At the mo, I've got file j.mp3 inside every folder of the root directory and running demo.basic.php generates this error in ie:

Code: Select all

Array ( [error] => Array ( [0] => "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpmp3\getid3-1.7.8b1\getid3\..GETID3_OS_DIRSLASHhelperapps" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist ) ) 
My code inside demo.basic.php is:

Code: Select all

<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org>               //
//  available at http://getid3.sourceforge.net                 //
//            or http://www.getid3.org                         //
/////////////////////////////////////////////////////////////////
//                                                             //
// /demo/demo.basic.php - part of getID3()                     //
// Sample script showing most basic use of getID3()            //
// See readme.txt for more details                             //
//                                                            ///
/////////////////////////////////////////////////////////////////

// include getID3() library (can be in a different directory if full path is specified)
require_once('../getid3/getid3.php');

// Initialize getID3 engine
$getID3 = new getID3;

$filename = "j.mp3";

// Analyze file and store returned data in $ThisFileInfo
$ThisFileInfo = $getID3->analyze($filename);

// Optional: copies data from all subarrays of [tags] into [comments] so
// metadata is all available in one location for all tag formats
// metainformation is always available under [tags] even if this is not called
getid3_lib::CopyTagsToComments($ThisFileInfo);

// Output desired information in whatever format you want
// Note: all entries in [comments] or [tags] are arrays of strings
// See structure.txt for information on what information is available where
// or check out the output of /demos/demo.browse.php for a particular file
// to see the full detail of what information is returned where in the array
echo @$ThisFileInfo['comments_html']['artist'][0]; // artist from any/all available tag formats
echo @$ThisFileInfo['tags']['id3v2']['title'][0];  // title from ID3v2
echo @$ThisFileInfo['audio']['bitrate'];           // audio bitrate
echo @$ThisFileInfo['playtime_string'];            // playtime in minutes:seconds, formatted string

print_r($ThisFileInfo);
?>

Anyone know what im doing wrong there?

Thx

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Fri Feb 02, 2007 9:51 am

Which version of getID3() are you using?

louis
User
Posts: 3
Joined: Fri Feb 02, 2007 2:14 am
Location: uk

Post by louis » Fri Feb 02, 2007 1:00 pm

im using version getid3-1.7.8b1

and demo.browse.php is working fine

louis
User
Posts: 3
Joined: Fri Feb 02, 2007 2:14 am
Location: uk

Post by louis » Mon Feb 05, 2007 10:20 am

any ideas what I'm doing wrong Allan?

thx

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Mon Feb 05, 2007 10:45 am

I think it is the same bug as mentioned here: http://www.getid3.org/phpBB2/viewtopic.php?t=721

Try using 1.7.7 instead.

Post Reply