mp3

This topic is: not resolved

This topic has 9 voices, contains 33 replies, and was last updated by  Devito 1219 days ago.

Viewing 15 posts - 16 through 30 (of 34 total)
Author Posts
Author Posts
August 7, 2008 at 2:20 am #173467

Last night I purchased the Gold Cart & MP3 plugin, then uploaded the files to their respective directories. I’m on a shared hosting account, so I can’t install Sox. However, I just plan on instaling Sox locally on my worktation & uploading the preview files manually. I do see the “MP3 Settings” message underneath the GoldCart options. I’ve searched the forums and none of the proposed solutions have allowed me to see the preview MP3 player. I’m running WP 2.5.1, wp e-commerce 3.6.7, & have tried all of the themes included with wp e-Commerce. A few questions:

1. When you upload mp3′s to the wspcpreviews directory, how do you go about associating that MP3 with a specific product? Am I supposed to have an additional button in my products page to choose my preview clips from?

2. Do the MP3 files have to be 30 seconds in length? I’m not a programmer, but I couldn’t see anything in the code restricting the size or length of the MP3 file which gets uploaded to the preview directory.

3. Do I need to edit anything in the mp3_functions.php file if I’m not using Sox? Do the lines which contain code like “WPSC_PREVIEW_URL.”/” or WPSC_PREVIEW_DIR.”/” need to be modified with my actual path location/URL? If so, what is the syntax?

There was nothing in the “Quick Start Guide” at all about setting up the audio player, and the instructions in the readme.txt just said to upload the mp3_functions directory underneath the gold_cart_files folder.

Any help is appreciated.

Thanks

August 7, 2008 at 4:46 am #173468

Devito

Hello Khalil… my advice would be to ignore the SoX feature… if it is already installed, then great, but if it is not there then it is more trouble than it’s worth…
.
Here’s how the (standard) ‘Upload Preview’ feature is supposed to work…. after uploading Gold and the MP3 mod (and activating your gold api) you should now have an additional button appearing (at the bottom of the ‘product download’ tab) when you first add a product… (but only when you first add a product)…
.
Should say… “Preview File: Choose file”… hit that button and select your preview…
.
And that would be it… create your own 30 clips and just upload them with each “new” product…
.
.
If this is not happening for you than you should take a look at:
http://www.instinct.co.nz/forums/topic.php?id=1083
.
In your… gold_cart_files/mp3_functions/… ‘mp3_functions.php’ you should check that you do not have a mimetype issue by removing some code:
if(($file_data['preview'] != ”) && ($file_data['preview_mimetype'] == ‘audio/mpeg’))
to
if($file_data['preview'] != ”)
.
Also if you have an old version of the MP3 mod you might want to check that all the paths inside the mp3_functions.php have been updated to the new preview location by changing the code from…
/wp-content/plugins/wp-shopping-cart/preview_clips/$mp3.mp3
to
/wp-content/uploads/wpsc/previews/$mp3.mp3
.
While you’re there ( mp3_functions.php ) you could add… param name=’wmode’ value=’transparent’
to line 47… If your pages aren’t white you might want this transparency…
And you can add any flashvars you need too…
.
.
The other (extra) method is SoX… the mod looks for a preview, doesn’t find one and so makes one out of your full length mp3 with SoX and lame etc… Personally I don’t care for this approach and have not installed all those components that are needed to make it work…
.
Hope this helps…

August 7, 2008 at 4:52 am #173469

Hmm…well, I made “some” progress. I noticed in the comments section of the mp3_functions that it will also look for a mp3 file based on the hased file name of the product. So as a test I copied the hashed file from the download directory to the “previews” directory and the button now shows up. So do I have to upload the products, then make whatever changes to the hashed mp3 filenames (shorten them to 30 seconds, etc.), and re-upload them to the previews directory? Is there an easier solution than that?

August 7, 2008 at 4:54 am #173470

Thanks Devito, I’ll give that a shot. Looks like we were both posting at the same time.

August 7, 2008 at 5:11 am #173471

Wow…that was embarrassing…LOL. I just tried creating a brand new product and the “Preview” option showed up. I was sitting here thinking how I could have missed that because I tried the same thing yesterday after installing the modules. Turns out that initially I had created an additional “mp3_functions” directory. So my path was:

…/gold_cart_files/mp3_functions/mp3_functions/mp3_functions.php

Before I realized the mistake, I had created a new product to test with but couldn’t find a preview button. I discovered my mistake last night and corrected the path to look like:

…/gold_cart_files/mp3_functions/mp3_functions.php

However, at that point I went back and expected to see a preview button for my existing products and it wasn’t there. Hence, the confusion. I didn’t realize that the preview button would only be available for new products.

The only thing that concerns me now is that whenever I want to change the voice tags on my MP3′s, I’ll have to create a new product. It would be nice if I could simply assign a different preview file for an existing product rather than having to re-create it. Or I suppose I could copy the files from the download directory to my workstation, use SoX or some other audio program to overly the voice tag, then re-upload them to my preview directory using the same hashed filenames. I’d need to use some type of batch audio processing program to automate it though, especially once I start offering hundreds of beats on my website.

Again, THANK YOU DEVITO!!

August 7, 2008 at 6:31 am #173472

Devito

Glad it’s working… “batch audio processing program…” now your talking ;)
Let us know how you get on…

Just to share it around… I recently changed the ‘FlashVars’ (mp3_functions.php – line 40)…
from…

name=’FlashVars’ value=’playerID=2&soundFile=$mp3_path’

to something like…

name=’FlashVars’ value=’playerID=2&bg=0xf8f8f8&leftbg=0xeeeeee&lefticon=0×999999&rightbg=0×999999&rightbghover=0×006600&
righticon=0×666666&righticonhover=0xffffff&text=0×666666&slider=0×336600&track=0xFFFFFF&border=0×666666&
loader=0×999999&soundFile=$mp3_path’

I found the best way to pick out a colour scheme was to install ‘Audio Player WordPress plugin’
http://www.1pixelout.net/code/audio-player-wordpress-plugin/
and change the colour scheme (flashvar’s) live in there settings tab… insert that player into a post… look at the source code and copy/paste the flashVars from there…

also… http://www.macloo.com/examples/audio_player/options.html

August 13, 2008 at 2:02 am #173473

Oooh no ! I Allready make 300 title cd in my web, is there any way to put the mp3 file after creating the product ?? It’s take so long to upload the 300 CD Title again. Anybody can help? Thanks

August 13, 2008 at 4:48 am #173474

Devito

Hello…
I have added the preview file manually a few times… I am no guru… but give this a try ;)

1) UP your preview (MP3) files to ‘…/wp-content/uploads/wpsc/previews’

2) Open your WP database and browse ‘wp_product_files’… find the product… and change it’s preview column to the name of the file you have uploaded…

August 13, 2008 at 6:41 am #173475

Thanks Devito, but how to open my WP database? using wp-admin or using another program?

August 13, 2008 at 8:24 am #173476

Hendra,

Another option might be to:

1. Install Sox on your local machine. – http://sox.sourceforge.net/

2. Download all of the hashed files in your wpsc/downloadable directory to your local machine.

3. Use the “trim” effect to specify the length of time you want your preview mp3′s to be, then apply it to all of the mp3 files in that same directory. – http://sox.sourceforge.net/soxeffect.html

4. Upload these modified files to the wspc/previews directory. When you load your products page you should be able to see the preview files for each of your products as long as the hashed filenames are the same.

Below is a segment of the Sox manual which talks about using the trim effect. I’m not sure what the exact command line is, however you should be able to figure this out from the additional instructions in the manual.

—————————
trim start [length]
Trim can trim off unwanted audio from the beginning and end of the audio. Audio is not sent to the output stream until the start location is reached.

The optional length parameter tells the number of samples to output after the start sample and is used to trim off the back side of the audio. Using a value of 0 for the start parameter will allow trimming off the back side only.

Both options can be specified using either an amount of time or an exact count of samples. The format for specifying lengths in time is hh:mm:ss.frac. A start value of 1:30.5 will not start until 1 minute, thirty and ½ seconds into the audio. The format for specifying sample counts is the number of samples with the letter `s’ appended to it. A value of 8000s will wait until 8000 samples are read before starting to process audio.
————————–

If you’re not on a shared host & can install Sox on your webserver, then I would just copy the hashed files to a temporary directory, apply the trim function, copy the modified files to the preview directory, then delete the temporary one.

Good luck and let us know how it works out.

- Khalil Guinn aka Lawrence

August 13, 2008 at 9:39 am #173477

Thanks Khalil. but the problem with sox is that i’m using mac. so i can;t use that.

For me the best way to trim 30 sec of MP3 is using iTunes, on the Get info Menu, there is option Start and Stop, then i go to the menu convert selection to mp3. (but first i have to rename it or duplicate it, because it don’t change the file name). It’s so flexible. It can be done also on Windows using iTunes.

I have done uploaded the mp3 files to the /wp-content/uploads/wpsc/previews’ but still don’t know how to link the mp3 file with the product. I try the admin menu but still cann’t do it.

Is there anyone can help me? Thanks

August 13, 2008 at 9:49 am #173478

Dear Devito regarding your second step :

2) Open your WP database and browse ‘wp_product_files’… find the product… and change it’s preview column to the name of the file you have uploaded…

do you mean to open the WP database using SQL menu in the Cpanel?

Does anybody have tried this way? Please advise me. Thanks

August 13, 2008 at 11:02 am #173479

Devito

Yeah I’m frightened to help you break your site…
When you first install word-press with your host… you will automatically create a MySQL database for all your posts and product info… called something like ‘wrdp1′ This can be accessed via your host control panel (cpanel/MySQL)… and it holds all your post and product info…
The best thing to do is to read your cpanel documentation and talk to your host… hope this gives you some direction…

Maybe one of them top WP Gurus shayne or arbie will be kind enough to walk you through it???
Softly, softly, catchee monkey :)

August 14, 2008 at 6:41 am #173480

Hendra,

When you uploaded the original mp3′s for your products, they get stored in the wspc/downloadables directory. The filenames are then changed to a hash name. There is a section of the mp3functions.php file that searches for a preview files based on the original hashed filename that is in the wspc/downloadables directory. For example:

1. Use FTP to look at your WSPC/Downloadables directory and find the last file which was added.
2. COPY that file from the WSPC/Downloadables to the WSPC/Previews directory.
3. Go into the e-Commerce plugin and find the last product that you added and the preview plugin should be there.

Now the goal here is to provide small snippets for your previews, so obviously you’ll want to trim the file you placed in that directory to whatever length you want. Trying to use iTunes to modify each one of those 300 files is not practical. So you’re better of looking for a similar audio program like CVS for the MAC that will allow you to write a batch process to cut the file lengths of these files.

Your only other choice is to use Devito’s method or delete all the products & recreate them. Otherwise, you’ll need some additional help from the WP Guru’s. I think you’re better off finding a program similar to SoX and following my initial instructions. That way there’s no screwing around with SQL databases, etc.

Good luck.

<<<<<<<
re: I have done uploaded the mp3 files to the /wp-content/uploads/wpsc/previews’ but still don’t know how to link the mp3 file with the product. I try the admin menu but still cann’t do it.

August 14, 2008 at 1:12 pm #173481

I meant “SoX”, not “CVS” in my last comment. Not sure how that happened, but anyway….hopefully you got the point.

Viewing 15 posts - 16 through 30 (of 34 total)

You must be logged in to reply to this topic.