Exporting To My Database

This section is now closed.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.

Mac 0S X 10.3 and earlier are no longer supported but you can download legacy versions of Audacity for those systems HERE.
Locked
toadybarker
Posts: 36
Joined: Wed Oct 21, 2009 5:36 pm
Operating System: Please select

Exporting To My Database

Post by toadybarker » Wed Jul 20, 2011 6:58 pm

Hi There,
I have a problem with exporting my WAV files to a database (mysql). I have created a version of Audacity which allows me to Export and Import from my Mysql database, and when I first save my "New" audio (WAV file) to my Database it works fine. Or it appears to because I can clear the track (hitting the X) and reload from the database what I saved and it sounds right. Looks right. Then, when I try to
Re-Export the track to my database it gets corrupted. So works the first time, but doesn't work after that. Maybe there is something going on in my load from the database pointers and/or the project is corrupted? Just weird that it plays fine and looks fine.

Seems to be using the exact same Export call it used to write it the first time....

The file size is usually about the same (sometimes exactly the same), but the file itself has missing end-of-line markers (sometimes it has NO end of line markers). The re-imported file is just dead air (straight line). It's the correct length though.

Anyone have an ideas what could do this. I orignially though it may be a format issue (44100 and 16 Bit PCM), but that seems to be the correct format when it reads it from the database, at least the labels DO match.

I did notice that when it writes it (the first time included), I do get something about exporting the entire project as WAV (Microsoft)...
but again it seems to read it fine the first time.

Tons of differences (#if defines) in the code when you are in the MAC environment as opposed to Windows, and I am porting this from my windows version which works fine, so I am thinking there is a mismatch happening somehow.....

kozikowski
Forum Staff
Posts: 68901
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Exporting To My Database

Post by kozikowski » Fri Jul 22, 2011 3:32 am

You can tell by the stunned silence that none of us have ever experienced anything like this before. Let us know how it comes out.

Koz

toadybarker
Posts: 36
Joined: Wed Oct 21, 2009 5:36 pm
Operating System: Please select

Re: Exporting To My Database

Post by toadybarker » Tue Jul 26, 2011 7:22 pm

Thanks..... Yeah, It's starting to leave a mark on my head (the brick wall)...

Latest theory is that when I am getting it out of the database there is some sort of conversion happenning (to AIFF Maybe?). I dunno....

Clearly confused as to why the normal Export works, even AFTER getting it from my database, it's only when I try to put it back...

toadybarker
Posts: 36
Joined: Wed Oct 21, 2009 5:36 pm
Operating System: Please select

Re: Exporting To My Database

Post by toadybarker » Fri Aug 12, 2011 5:54 pm

After weeks of digging around we found the problem was in the Preference settings.....This appears to be a MAC only issue, as the Windows version set this way did not exhibit the behavior.

The Preferences - Import/Export settings has three (3) choices for importing -

1 Make a copy of uncompressed audio before editing (safer)
2 Read uncompressed audio files directly from original (faster) and
3 Normalize all tracks in project.

My setting was number 2 (Read directly from file), but when I changed it to make a copy and use that - voila - successfully wrote the audio out correctly to the destination file (overwriting it).

Not exatcly sure why this occurs since the normal export seems to handle it fine - but - it does use the word Safer.... sigh...

Thanks to all who looked at this...

bgravato
Posts: 2080
Joined: Wed Jan 13, 2010 8:56 pm
Operating System: Please select

Re: Exporting To My Database

Post by bgravato » Sat Aug 13, 2011 2:14 am

Thank you for the feedback.

So from what I understood you're using a modified version of Audacity, meaning that you modified audacity's source code to write directly to the mysql database... am I right on this?

Safer option will copy the audio to audacity and make a copy of it, that will go either to memory or temporary file on harddisk. The faster option will read the audio directly from the original wav file.

I don't know how you changed the source, but the problem can be there... The source code has different blocks depending on the operating system. Also different operating system, different file systems and the way files are managed will vary...

It might happen that you need to change more than one block regarding file manipulation and because files are managed differently in different systems what works for one might not work for the other.
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).

Locked