needed by the last TimeSide decoder prevents from giving a real first streaming (TODO).
- Add examples for Apache2 mod-wsgi conf and django settings
- Fix documentation
TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data"
CACHE_BACKEND = "file://" + TELEMETA_CACHE_DIR + "/data"
+You can find an example for settings.py there::
+
+ conf/examples/django/settings.py
+
+
--------------------------
5. Initialize the database
--------------------------
The simplest case is to have telemeta running at public root. To do so, add this url in urls.py::
(r'^', include('telemeta.urls')),
+ (r'^i18n/', include('django.conf.urls.i18n')),
+
+You can find an example for url.py there::
+
+ conf/examples/django/urls.py
--------------------
If you want to use Telemeta through a web server, it is highly recommended to use Apache 2
with the mod_wsgi module as explained in the following page :
-http://docs.djangoproject.com/en/1.1/howto/deployment/modwsgi/#howto-deployment-modwsgi
+ http://docs.djangoproject.com/en/1.1/howto/deployment/modwsgi/#howto-deployment-modwsgi
This will prevent Apache to put some audio data in the cache memory as it is usually the case with mod_python.
+You can find an example of an Apache2 VirtualHost conf file there::
+
+ conf/examples/apache2/telemeta.conf
+
+
-------------------------
10. Contact / More infos
-------------------------
See README and http://telemeta.org.
-
:Emails: Guillaume Pellerin <yomguy@parisson.com>,
Olivier Guilyardi <olivier@samalyse.com>,
- Riccardo Zaccarelli <riccardo@parisson.com>
+ Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
Sponsors
========
http://www.musee-europemediterranee.org
* MMSH : Maison Méditerranéenne des Sciences de l'Homme
http://www.mmsh.univ-aix.fr/
- * The Antropponet Project
+ * The Antropponet Project (ended)
--- /dev/null
+<VirtualHost *:80>
+ ServerAdmin webmaster@localhost
+ ServerName telemeta.wm22.parisson.org
+
+ LogLevel warn
+ ErrorLog ${APACHE_LOG_DIR}/error-telemeta.log
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ CustomLog ${APACHE_LOG_DIR}/access-telemeta.log combined
+
+ Alias /media/ /home/dev/telemeta/sandboxes/sandbox_generic/media/
+ <Directory /home/dev/telemeta/sandboxes/sandbox_generic/>
+ Order deny,allow
+ Allow from all
+ </Directory>
+
+ WSGIDaemonProcess telemeta_test user=momo group=momo threads=12 processes=4 maximum-requests=1000
+ #deadlock-timeout=1000
+ WSGIProcessGroup telemeta_test
+ WSGIApplicationGroup %{GLOBAL}
+ WSGIScriptAlias / /home/dev/telemeta/sandboxes/sandbox_generic/wsgi/sandbox_generic.wsgi
+
+ <Directory /home/dev/telemeta/sandboxes/sandbox_generic/wsgi/>
+ Order deny,allow
+ Allow from all
+ </Directory>
+
+# Disallow browsing of Subversion working copy administrative dirs.
+<DirectoryMatch "^/.*/\.svn/">
+ Order deny,allow
+ Deny from all
+</DirectoryMatch>
+
+#<Location "/media">
+# SetHandler None
+#</Location>
+
+Alias /favicon.ico /home/dev/telemeta/telemeta-unstable/telemeta/htdocs/images/favicon.ico
+
+<LocationMatch "\.(ico|txt)$">
+ SetHandler None
+</LocationMatch>
+
+</VirtualHost>
--- /dev/null
+# -*- coding: utf-8 -*-
+# Django settings for sandbox project.
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+ ('Guillaume Pellerin', 'yomguy@parisson.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+# 'OPTIONS': { 'init_command': 'SET storage_engine=INNODB', },
+ 'NAME': 'telemeta_generic', # Or path to database file if using sqlite3.
+ 'USER': 'telemeta', # Not used with sqlite3.
+ 'PASSWORD': 'xxxxxxx', # Not used with sqlite3.
+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
+ }
+}
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'France/Paris'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+#LANGUAGE_CODE = 'fr_FR'
+LANGUAGES = [ ('fr', 'French'),
+ ('en', 'English'),
+]
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = '/home/dev/telemeta/sandboxes/sandbox_generic/media/'
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = 'http://telemetagen.parisson.com/media/'
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = 'http://localhost/django/media/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'a8l7%06wr2k+3=%#*#@#hdie2mmzko)4jdloz(zx%lls^ihm9^5'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+# 'django.template.loaders.eggs.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.locale.LocaleMiddleware',
+)
+
+ROOT_URLCONF = 'sandbox_generic.urls'
+
+TEMPLATE_DIRS = (
+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+)
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.messages',
+ 'django.contrib.admin',
+ 'telemeta',
+ 'jsonrpc',
+)
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+ 'django.core.context_processors.request',
+ 'django.contrib.auth.context_processors.auth',
+)
+
+
+TELEMETA_ORGANIZATION = 'Parisson'
+TELEMETA_SUBJECTS = ('telemeta', 'tests')
+TELEMETA_GMAP_KEY = 'ABQIAAAArg7eSfnfTkBRma8glnGrlxRVbMrhnNNvToCbZQtWdaMbZTA_3RRGObu5PDoiBImgalVnnLU2yN4RMA'
+TELEMETA_DOWNLOAD_ENABLED = True
+TELEMETA_PUBLIC_ACCESS_PERIOD = 51
+AUTH_PROFILE_MODULE = 'telemeta.userprofile'
+
+LOGIN_URL = '/login'
+LOGIN_REDIRECT_URL = '/'
+EMAIL_HOST = 'smtp.free.fr'
+DEFAULT_FROM_EMAIL = 'webmaster@parisson.com'
+
+TELEMETA_CACHE_DIR = MEDIA_ROOT + 'cache'
+TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export"
+TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data"
+CACHE_BACKEND = "file://" + TELEMETA_CACHE_DIR + "/data"
+SESSION_EXPIRE_AT_BROWSER_CLOSE = False
+
--- /dev/null
+# -*- coding: utf-8 -*-
+from django.conf.urls.defaults import *
+
+# Uncomment the next two lines to enable the admin:
+from django.contrib import admin
+admin.autodiscover()
+
+urlpatterns = patterns('',
+ # Example:
+ # (r'^sandbox/', include('sandbox.foo.urls')),
+
+ # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
+ # to INSTALLED_APPS to enable admin documentation:
+ # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+
+ # Uncomment the next line to enable the admin:
+ (r'^djangoadmin/', include(admin.site.urls)),
+ (r'^', include('telemeta.urls')),
+ # Languages
+ (r'^i18n/', include('django.conf.urls.i18n')),
+)
return render_to_response(template, data, context_instance=RequestContext(request),
mimetype=mimetype)
-def stream_from_processor(decoder, processor):
- _decoder = decoder
- _processor = processor
+def stream_from_processor(__decoder, __processor):
while True:
- __frames, eod = _decoder.process()
- __chunk, eodproc = _processor.process(_frames, eod)
+ __frames, eodproc = __processor.process(*__decoder.process())
if eodproc:
break
- yield __chunk
+ yield __processor.chunk
def stream_from_file(file):
chunk_size = 0x10000
else:
if not self.cache_export.exists(file):
- if not decoder:
- decoder = timeside.decoder.FileDecoder(audio)
+ decoder = timeside.decoder.FileDecoder(audio)
# source > encoder > stream
decoder.setup()
media = self.cache_export.dir + os.sep + file
proc = encoder(media, streaming=True)
- proc.setup(channels=decoder.channels(), samplerate=decoder.samplerate(), nframes=decoder.nframes())
+ proc.setup(channels=decoder.channels(), samplerate=decoder.samplerate())
# metadata = dublincore.express_item(item).to_list()
# enc.set_metadata(metadata)
response = HttpResponse(stream_from_processor(decoder, proc), mimetype = mime_type)