Message
par iCed » 17 sept. 2005, 12:15
Bonjour ! Je me présente, je m'appelle Cédric, iCed pour les forums. Je suis l'évolution du site de Joachim depuis l'année dernière, j'ai entendu ses premiers Mixes sur Underground Fg et comme beaucoup d'entre vous sûrement : j'adore ce qu'il fait. Ne résistant plus à la tentation de m'inscrire sur le forum, me voici !
Pour mon 1er post, je vous propose un petit cadeau qui ravira les Mac Users. Il s'agit d'un script permettant de convertir le texte écrit dans TextEdit en un fichier Aiff. Ce petit script est disponible sur le site d'Apple, mais je vous le propose ici dans une version légèrement modifiée par mes soins pour s'intégrer plus facilement à Mac OS X :
property voice_names : {"Agnes", "Albert", "Bad News", "Bahh", "Bells", "Boing", "Bruce", "Bubbles", "Cellos", "Deranged", "Fred", "Hysterical", "Junior", "Kathy", "Pipe Organ", "Princess", "Ralph", "Trinoids", "Vicki", "Victoria", "Whisper", "Zarvox"}
property default_voice : "Victoria"
tell application "TextEdit"
activate
try
set this_string to (the text of document 1) as string
if this_string is "" then error "This document contains no text."
set this_voice to (choose from list voice_names default items default_voice with prompt "Pick the voice to use:") as string
if this_voice is "false" then
exit repeat
else
set default_voice to this_voice
end if
set the target_file to choose file name with prompt "Name and location for the sound file:" default name "rendered.aiff"
say this_string using default_voice saving to target_file
display dialog "Rendering completed." buttons {"Play File", "OK"} default button 2
if the button returned of the result is "Play File" then
tell application "QuickTime Player"
activate
stop every movie
open target_file
play movie 1
end tell
end if
on error error_message number error_number
if the error_number is not -128 then
display dialog error_message buttons {"Cancel"} default button 1
end if
end try
end tell
Copier le dans l'éditeur de script (Application>Utilitaires>Éditeurs de Scripts) puis enregistrer comme "Application" "exécutable uniquement".
Voilà. En espérant que ça vous plaira.
--- iCed ---