I now tried to automatically get all combinations which produce 7 mp3 files.

Here is the code:

use strict; use warnings; use Audio::FindChunks; my @min_silence_sec_list = map { $_/100 } (0..50); my @min_signal_sec_list = map { $_/100 } (0..50); my @above_thres_window_list = (0,1,2,3,4); open( my $CSV_FH, ">", "split_results.csv") or die $!; for my $min_silence_sec ( @min_silence_sec_list ) { for my $min_signal_sec ( @min_signal_sec_list ) { for my $above_thres_window ( @above_thres_window_list ) { Audio::FindChunks->new(filename => 'bere.mp3', min_silence_sec => $min_silence_sec +, min_signal_sec => $min_signal_sec, + above_thres_window => $above_thres_ +window)->split_file(); my @split_mp3_files = glob("*_bere.mp3"); my $num_chunks = scalar(@split_mp3_files); unlink(@split_mp3_files); if( $num_chunks == 7 ) { print $CSV_FH "$min_silence_sec;$min_signal_sec;$above_thres_win +dow\n"; } } } } close($CSV_FH);

Afterwards I tried some of these combinations. But the results are not good. Often the split is done in the middle of a word,...

Difficult how to continue now with this module.

But I learned one obvious thing from you and I don't know why I did not have this idea on my own. I was first trying manually the possible combinations. But you are right with your advice to do this automatically with a script as I have done it now.

But the good message is that I now know how to solve the problem with audacity. It has a "Soundfinder" plugin and this is working perfectly with all my mp3 files.

I'm still interested how to solve it with the Audio::FindChunks module. But I don't know how to continue now. Perhaps taking more parameters into account and trying more combinations or even comparing the split times with the correct split times I got from audacity.


In reply to Re^4: Split MP3 file at silence by Dirk80
in thread Split MP3 file at silence by Dirk80

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.