I would check the audio files properties, ie size of the file to the byte to make sure it’s the same when it goes into the database as when it comes out.  Is the same when it goes in as when It comes out?  What is happening to the recording when it gets written into the database?  Is the header being stripped or added to?  I see that you are using the convert function in SQL.  I don’t have any experience with the function but I would take a closer look at convert to be sure its doing what its expected from you to do.

 

 If that doesn’t work, perhaps creating a directory to store your audio files and only keeping the path to the audio file in the database would be a viable solution.

 

We work with millions of recordings daily and our method is to keep a terabyte system that stores the recordings and simply keeping the path and file name of the recording in the database.

 

I hope this helps.

 

Dan

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Barker
Sent: Tuesday, April 18, 2006 9:40 AM
To: [email protected]
Subject: Image - Audio file

 

I have a SQL database that contains an audio file as an image.  I am attempting to pull it out and create an ASF file.  The script does pull it out - but the file is un-playable.  Anyone have any ideas?  Code snippet below.

 

TIA

 

$dbh1->{LongReadLen} = 1024 * 1024;
my $sql0 = "select convert(binary(4000),recording)
     from databasetablename

     where convert(varchar(8),reportdate,112) = '20060414'
     and recording is not null
     and intcode = '19077'";
my $sth0 = $dbh1->prepare($sql0);
$sth0->execute || die "Can't perform select\n";

my $var = $sth0->fetchrow;


my $file = "rec.asf";
open(FILE1,">$file") || die "Can't open $file\n";
print FILE1 "$var";
close FILE1;

$sth0->finish;

 

 

Ken Barker

IT Lead

Tel: 314-213-7927

1100 Corporate Square

St. Louis, MO 63132

[EMAIL PROTECTED]

The information in this e-mail is confidential and intended solely for the person to whom it is addressed. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail and then delete the message from your computer. Americall Group, Inc. cannot be held responsible or liable in any way whatsoever for and/or in connection with any consequences and/or damage resulting from the dispatch and receipt of this e-mail and the content of this e-mail. Americall Group, Inc. takes no responsibility for any computer virus that might be transferred by way of this email.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to