Il Blog di Fabrizio Mondo

Streamripper, scendiamo nel dettaglio

marzo 26, 2007 11:32 pm

Engines
Trentatreesimo articolo dedicato alle web radio.

Abbiamo parlato a lungo di Streamripper, sia introducendolo, che parlandone per Ambiente Windows e per ambiente Linux. Abbiamo anche minimamente discusso, di come sia utile per ottenere mp3 rapidamente.

Vediamo di scendere un pò nei dettagli tecnici.

Cominciamo esaminando il manuale di Streamripper per linux, in alcune sue parti, tramite il semplice comando: man streamripper.

DESCRIPTION
Streamripper records shoutcast and icecast compatible streams. It uses
meta data within a shoutcast stream to determine the beginning and end
of each song, and stores the songs on your hard disk as individual mp3
files. In addition, streamripper includes a relay server for listening
to the station while you are recording

Streamripper registra Flussi in streaming di Shoutcast ed Icecast. Usa metadata trasmessi insieme al flusso per determinare inizio e fine di ciascuna canzone, e salva le canzoni sul tuo hard disk come mp3 separati. In aggiunta, Streamripper permette di creare un relay per l’ascolto della stazione che stai registrando.

SPLITPOINT DETECTION
Streamripper automatically splits tracks based on detection of a silent
near the meta interval where the track changes. However, this method is
imperfect, and sometimes the track splitting occurs is too early or too
late. These options will fine tune the track splitting capabilities
for streams that use cross-fading, which causes streamripper’s auto‐
matic silence detection routine to fail.

Various –xs flags can be used to add an offset for streams that have a
meta interval that comes too early or too late, to add extra padding to
the beginning and end of each song, and to decide where the length of
the search window and silence window.

Streamripper effettua il taglio tra un file ed un altro, quando incontra un attimo “silente”, ovvero un momento in cui non c’è effettivamente alcun suono. Se non lo trova fa quello che può, ovviamente DOPO l’invio dei metadati per il cambio di canzone.
Questo “periodo” in cui si cerca il punto di silenzio è chiamato “search window“. Questa finestra, specialmente se
ci si trova in casi di crossfading tra i brani, può essere allungata a piacimento.

DEFAULT SPLITTING
The default spitting algorithm is used when no silent point can be
found. Suppose you have a meta-int with track change information at
the time “mi” (see figure below).

If the xs_offset is positive, the track separation point “ts” is later
the “mi” point. If xs_offset is negative, “ts” is earlier than “mi”.
Once “ts” is determined, a user-defined “prepad” and “postpad” are used
to determine where the next track begins “ntb”, and where the previous
track ends “pte”. The interval between “ntb” and “pte” will be copied
to both songs.

Splitting mode

Cosa succede quindi se non si trova il “silent point”?

Si supponga di avere delle meta informazioni di cambio, al tempo MI (guardate la figura di sopra).
Se l’offset XS è positivo (XS_offset setta il tempo della search window, e può essere positivo per tagli in avanti, e negativo per tagli all’indietro) il separatore TS della canzone è DOPO il tempo MI. Se xs_offset è negativo, il viceversa.
Una volta determinato questo istante TS (che ricordo, è dato da: Metadata + Offset) un “Prepad” e “Postpad” sono impostati, e tutto quello che sta compreso traPrepad e Postpad sarà copiato in ENTRAMBE le canzoni.

SILENCE SEPARATION
Splitting based on silence separation is similar to default splitting,
only slightly more complex. Again, suppose you have a meta-int with
track change information at the time “mi” (see figure below).

A search window “search_win” is determined by the xs_offset, pre_sw,
and post_sw field. The beginning of the search window is at: mi +
xs_offset – pre_sw and the end of the search window is at: mi + xs_off‐
set + post_sw.

La separazione basata sui silenzi è simile alla separazione standard, solo un pò più complessa. Ancora, supponiamo che al tempo mi ci sia il cambio di canzone con metadati connessi.

Una finestra di ricerca denominata “search_win” viene determinata dai campi xs_offset, pre_sw e post_sw. Questa finestra comincia all’istante mi + xs_offset – pre_sw e termina all’istante mi + xs_offset + post_sw

If there is a silent interval of length “silence_win” within the
“search_win”, the center of “silence_win” is selected as the track sep‐
aration point “ts”.

Once “ts” is determined, a user-defined “prepad” and “postpad” are used
to determine where the next track begins “ntb”, and where the previous
track ends “pte”. The interval between “ntb” and “pte” will be copied
to both songs.

Se c’è un momento di silenzio di grandezza “silence_win” insieme alla finestra di ricerca il punto centrale del momento di silenzio è selezionato come separatore di traccia.

Una volta determinato il punto TS (track separator) i campi prepad e postpad, sono utilizzati per selezionare quali parti verranno copiate in entrambe le canzoni.

Silence

2 Responses to “Streamripper, scendiamo nel dettaglio”

art3k wrote a comment on marzo 29, 2007

Ciao! ho appena consigliato il tuo sito ad un amico che ha una radio online (prima l’aveva anche in FM) non so se conosci music1radio …. evito di spammarti il link.. però con una ricerchina su google lo peschi subito… era felice di vedere il tuo lavoro… io continuo a lavorare sul mio server… bye ;)

Fabrizio Mondo wrote a comment on marzo 29, 2007

Grazie mille!!

Care to comment?