Tuesday, February 24, 2009

convertir videos youtube en audio

Et baixes el program youtube-dl. Aquest funciona des de la linia de comandaments.

$ youtube-dl "http://www.youtube.com/watch?v=elquesigui"

Així baixarà el video en el arxiu elquesigui.flv

I després s'extreu l'audio (mp3) del video.

$ mplayer -dumpaudio -dumpfile audio.mp3 nom_del_video.flv

Trobareu la resposta a http://ubuntuforums.org/archive/index.php/t-821640.html

Gràcies a orestesmas

Festival, Text to Speech d'Ubuntu



Festival és un programa que utilitza veus sintetitzades per llegir textos en diferents idiomes. Festival incorpora algunes veus per defecte, però podem afegir-ne d'altres.

Per afegir les veus catalanes hem de visitar el projecte Festcat. Tutorials per a la instal·lació i ús els trobareu aquí. Descarrega de veus aquí.

En castellà tenim les veus del projecte Hispavoces de Guadalinex y la Junta de Andalucia. Veure aquest link, i per instal·lar aquest altre.

En castellà i anglés el projecte Mbrola les ha millorat. Podeu seguir les instruccions per a la instal·lació aquí, tenint en compte el que es diu també aquí. En el meu cas, la instal·lació no ha esta pas fàcil. De fet he tingut que fer servir el binari mbrola-linux-i386, en compte del 64 que em pertocaria, i he tingut que instalar el festival-dev (no ser segur si ha servit de res).



Resum per a lús de festival

- MOLT IMPORTANT: cal que els arxius de text a convertir tinguin codificació latin-1

- festival a consola
$ echo hola mon | festival --language catalan --tts
$ festival --language catalan --tts arxiu.txt
$ cat arxiu.txt | festival --language catalan --tts

-festival en batch
$ festival
festival> (save_waves_during_tts)
(language_catalan)
(tts_file "arxiu.txt")
(exit)
$ festival
festival> (language_catalan)
(intro-catalan)
(SayText "Bon dia, Catalunya.")
(SayText "Bona nit.")
(exit)
$ festival
festival> (voice_upc_ca_ona_hts)
(SayText "I tu, qui ets?")
(voice_upc_ca_pau_hts)
(SayText "Jo sóc, el que tu ets, i si et faig mal, em faig mal a mi mateix.")
(voice_upc_ca_ona_hts)
(SayText "Que maco. Això és de l'assemblea dels infants, oi?")
(exit)

- $ text2wave: converteix txt a wav.
$ text2wave -o arxiu.wav -eval '(language_catalan)' arxiu.txt
$ man text2wave

- Dubtes: $ man festival

- català per omisió d'inici
cal crear un arxiu de text a la carpeta de l'usuari, el nom de l'arxiu ha de ser .festivalrc
$ gedit .festivalrc
Al seu interior copiarem la línia següent, a la que podem triar qualsevol de les veus instal·lades
(set! voice_default 'voice_upc_ca_ona_hts)


Veus

voice_upc_ca_ona_hts o _clunits
voice_upc_ca_pau_hts o _clunits
voice_upc_ca_teo_hts o _clunits
voice_upc_ca_pol_hts o _clunits
voice_upc_ca_pep_hts o _clunits
voice_upc_ca_mar_hts o _clunits
voice_upc_ca_jan_hts o _clunits
voice_upc_ca_eva_hts o _clunits
voice_upc_ca_eli_hts o _clunits
voice_upc_ca_bet_hts o _clunits

voice_rab_diphone. A British English male RP speaker, Roger.

voice_ked_diphone. An American English male speaker, Kurt.

voice_kal_diphone. An American English male speaker.

voice_don_diphone. Steve Isard's LPC based diphone synthesizer, Donovan diphones.

voice_el_diphone. A male Castilian Spanish speaker, using the Eduardo Lopez diphones.

voice_gsw_diphone. This offers a male RP speaker, Gordon, famed for many previous CSTR synthesizers, using the standard diphone module.

voice_en1_mbrola. The Roger diphone set using the same front end as voice_rab_diphone but uses the MBROLA diphone synthesizer for waveform synthesis.

voice_us1_mbrola. A female Amercian English voice using our standard US English front end and the us1 database for the MBROLA diphone synthesizer for waveform synthesis.

voice_us2_mbrola. A male Amercian English voice using our standard US English front end and the us2 database for the MBROLA diphone synthesizer for waveform synthesis.

voice_us3_mbrola. Another male Amercian English voice using our standard US English front end and the us2 database for the MBROLA diphone synthesizer for waveform synthesis.

voice_JuntaDeAndalucia_es_pa_diphone. Voz masculina castellana de la Junta de Andalucia (Pedro).

voice_JuntaDeAndalucia_es_sf_diphone. Voz femenina castellana de la Junta de Andalucia (Silvia).