scooter41 Posted July 28, 2008 Share Posted July 28, 2008 Hi there, I often use LAME with a php script to dynamically compress 320k mp3's for an online store, and make 96k preview mp3's. However the client now wants to take a 'portion' of that track to play as a preview only. I use the following command to dynamically convert the whole track, however is it possible to specify start and end times perhaps so I can just trim the middle portion of the track? $encode_cmd = "/usr/bin/lame/bin/lame -b 96 --resample 44.1 $origFile $convFile"; $output = exec($encode_cmd . ' 2>&1', $output, $return); Thanks for any help in advance!! Link to comment https://forums.phpfreaks.com/topic/116970-trim-a-section-when-encoding-mp3-with-lame/ Share on other sites More sharing options...
zq29 Posted August 3, 2008 Share Posted August 3, 2008 I'm not sure that you can do that with LAME, have you read the man pages? If not, take a look into sox, I think that has a higher level of control when manipulating audio files. Link to comment https://forums.phpfreaks.com/topic/116970-trim-a-section-when-encoding-mp3-with-lame/#findComment-606796 Share on other sites More sharing options...
unkwntech Posted August 3, 2008 Share Posted August 3, 2008 I have used MP3Gain for something similar. Link to comment https://forums.phpfreaks.com/topic/116970-trim-a-section-when-encoding-mp3-with-lame/#findComment-606798 Share on other sites More sharing options...
cooldude832 Posted August 3, 2008 Share Posted August 3, 2008 what if you stream the full length into the player but stop the stream at a certain point creating your "smaller" section. Don't know exactly how to do it but it sounds reasonable Link to comment https://forums.phpfreaks.com/topic/116970-trim-a-section-when-encoding-mp3-with-lame/#findComment-606801 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.