1 ;;;transcribe.el --- package for audio transcriptions
3 ;;Copyright 2014 David González Gándara
5 ;;Author: David Gonzalez Gandara <dggandara@member.fsf.org>
8 ;;This program is free software: you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ;; to install manually:
26 ;; Copy this file to somewhere in your drive
28 ;; To load the file --> M-: (load "~/transcribe.el") --- change the route to where you copied the file
31 ;; C-x C-n --> new episode structure
32 ;; <f6> ----> New tag. Interactively insert new tag
33 ;; C-x C-a ----> call interactively analyze_episodes.py to extract interactions by a person
34 ;; C-x C-p ----> play audio file
35 ;; <f5> ----> pause or play audio
36 ;; C-x <right> ----> seek 10 seconds forward
37 ;; C-x <left> ---->seek 10 seconds backward
38 ;; <f8> ----> seek interactively: positive seconds go forward and negative seconds go backward
39 ;; <f11> --------> l1 tag
40 ;; <f12> --------> l2 tag
45 ;(require 'emms-player-mpd)
46 ;(setq emms-player-mpd-server-name "localhost")
47 ;(setq emms-player-mpd-server-port "6600")
50 (emms-default-players)
51 (require 'emms-player-mpg321-remote)
52 (push 'emms-player-mpg321-remote emms-player-list)
54 (require 'emms-mode-line)
56 (require 'emms-playing-time)
59 (global-set-key (kbd "C-x C-p") 'emms-play-file)
61 (global-set-key (kbd "<f5>") 'emms-pause)
63 (global-set-key (kbd "C-x <down>") 'emms-stop)
65 (global-set-key (kbd "C-x <right>") 'emms-seek-forward)
67 (global-set-key (kbd "C-x <left>") 'emms-seek-backward)
69 (global-set-key (kbd "<f8>") 'emms-seek)
71 (defun analyze-episode (episode person)
72 (interactive "sepisode: \nsperson:")
73 (shell-command (concat (expand-file-name "analyze_episodes2.py") " -e " episode " -p " person " -i " buffer-file-name )))
75 (global-unset-key (kbd "C-x C-A"))
76 (global-set-key (kbd "C-x C-A") 'analyze-episode)
78 (defun draw-boxplot ()
80 (shell-command (concat (expand-file-name "/usr/bin/Rscript ") "boxplot_students.R " buffer-file-name)))
82 (global-unset-key (kbd "C-x C-B"))
83 (global-set-key (kbd "C-x C-B") 'draw-boxplot)
85 (defun define-xml-tag (xmltag)
87 (insert (format "<%s></%s>" xmltag xmltag))
89 (backward-char (string-width xmltag)))
99 (insert "<l2 clauses=\"1\" errors=\"0\"></l2>")
103 (fset 'xml-tag-l2-break "</l2><l2 clauses=\"1\" errors=\"0\">")
104 (fset 'set-attributes "clauses=\"1\" errors=\"0\"")
106 (defun display-audio-info ()
108 (emms-player-mpg321-remote-proc)
109 (shell-command "/usr/bin/mpg321 -R - &"))
112 (global-set-key (kbd "<f6>") 'define-xml-tag)
113 (global-set-key (kbd "<f7>") 'xml-tag-l2-break)
114 (global-set-key (kbd "<f4>") 'set-attributes)
115 (global-set-key (kbd "<f11>") 'xml-tag-l1)
116 (global-set-key (kbd "<f12>") 'xml-tag-l2)
119 "<episode>\n<number>DATE-NUMBER</number>\n<duration></duration>\n<comment></comment>\n<subject>Subject (level)</subject>\n<task>\n\t<role>low or high</role>\n<context>low or high</context>\n<demand>low or high</demand>\r</task>\n<auxiliar>Yes/no</auxiliar>\n<transcription>\n</transcription>\n</episode>")
121 (global-unset-key (kbd "C-x C-n"))
122 (global-set-key (kbd "C-x C-n") 'NewEpisode)
124 ;;;transcribe.el ends here