Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (86)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (5848)

  • Using ffmpeg to convert voice recording captured by HTML5

    8 juillet 2014, par user3789242

    I’m building an HTML5 voice recording software with visualizer.I want the user when recording the voice, and after uploading the file as wave in a blob (server-side), the user should be able to select the audio format of that file using ffmpeg. what I Have achieved so far is uploading the file as wave.what I still want to do is :

    • On the server
    • side pick your preferable web programming framework
    • The web programming framework accepts the upload and stores the file on the server
    • The web programming framework runs a ffmpeg (command line) which processes the file
    • The user can download the processed file

    here is my code so far :

    // variables
    var leftchannel = [];
    var rightchannel = [];
    var recorder = null;
    var recording = false;
    var recordingLength = 0;
    var volume = null;
    var audioInput = null;
    var sampleRate = 44100;
    var audioContext = null;
    var context = null;
    var outputString;



    if (!navigator.getUserMedia)
       navigator.getUserMedia = navigator.getUserMedia ||
       navigator.webkitGetUserMedia ||
       navigator.mozGetUserMedia ||
       navigator.msGetUserMedia;

    if (navigator.getUserMedia) {
       navigator.getUserMedia({
           audio: true
       }, success, function (e) {
           alert('Error capturing audio.');
       });
    } else alert('getUserMedia not supported in this browser.');



    function getVal(value) {

       // if R is pressed, we start recording
       if (value == "record") {
           recording = true;
           // reset the buffers for the new recording
           leftchannel.length = rightchannel.length = 0;
           recordingLength = 0;
           document.getElementById('output').innerHTML = "Recording now...";

           // if S is pressed, we stop the recording and package the WAV file
       } else if (value == "stop") {

           // we stop recording
           recording = false;
           document.getElementById('output').innerHTML = "Building wav file...";

           // we flat the left and right channels down
           var leftBuffer = mergeBuffers(leftchannel, recordingLength);
           var rightBuffer = mergeBuffers(rightchannel, recordingLength);
           // we interleave both channels together
           var interleaved = interleave(leftBuffer, rightBuffer);



           var buffer = new ArrayBuffer(44 + interleaved.length * 2);
           var view = new DataView(buffer);

           // RIFF chunk descriptor
           writeUTFBytes(view, 0, 'RIFF');
           view.setUint32(4, 44 + interleaved.length * 2, true);
           writeUTFBytes(view, 8, 'WAVE');
           // FMT sub-chunk
           writeUTFBytes(view, 12, 'fmt ');
           view.setUint32(16, 16, true);
           view.setUint16(20, 1, true);
           // stereo (2 channels)
           view.setUint16(22, 2, true);
           view.setUint32(24, sampleRate, true);
           view.setUint32(28, sampleRate * 4, true);
           view.setUint16(32, 4, true);
           view.setUint16(34, 16, true);
           // data sub-chunk
           writeUTFBytes(view, 36, 'data');
           view.setUint32(40, interleaved.length * 2, true);


           var lng = interleaved.length;
           var index = 44;
           var volume = 1;
           for (var i = 0; i < lng; i++) {
               view.setInt16(index, interleaved[i] * (0x7FFF * volume), true);
               index += 2;
           }

           var blob = new Blob([view], {
               type: 'audio/wav'
           });

           // let's save it locally

           document.getElementById('output').innerHTML = 'Handing off the file now...';
           var url = (window.URL || window.webkitURL).createObjectURL(blob);

           var li = document.createElement('li');
           var au = document.createElement('audio');
           var hf = document.createElement('a');

           au.controls = true;
           au.src = url;
           hf.href = url;
           hf.download = 'audio_recording_' + new Date().getTime() + '.wav';
           hf.innerHTML = hf.download;
           li.appendChild(au);
           li.appendChild(hf);
           recordingList.appendChild(li);

       }
    }


    function success(e) {

       audioContext = window.AudioContext || window.webkitAudioContext;
       context = new audioContext();


       volume = context.createGain();

       // creates an audio node from the microphone incoming stream(source)
       source = context.createMediaStreamSource(e);

       // connect the stream(source) to the gain node
       source.connect(volume);

       var bufferSize = 2048;

       recorder = context.createScriptProcessor(bufferSize, 2, 2);

       //node for the visualizer
       analyser = context.createAnalyser();
       analyser.smoothingTimeConstant = 0.3;
       analyser.fftSize = 512;

       splitter = context.createChannelSplitter();
       //when recording happens
       recorder.onaudioprocess = function (e) {

           if (!recording) return;
           var left = e.inputBuffer.getChannelData(0);
           var right = e.inputBuffer.getChannelData(1);

           leftchannel.push(new Float32Array(left));
           rightchannel.push(new Float32Array(right));
           recordingLength += bufferSize;

           // get the average for the first channel
           var array = new Uint8Array(analyser.frequencyBinCount);
           analyser.getByteFrequencyData(array);

           var c = document.getElementById("myCanvas");
           var ctx = c.getContext("2d");
           // clear the current state
           ctx.clearRect(0, 0, 1000, 325);
           var gradient = ctx.createLinearGradient(0, 0, 0, 300);
           gradient.addColorStop(1, '#000000');
           gradient.addColorStop(0.75, '#ff0000');
           gradient.addColorStop(0.25, '#ffff00');
           gradient.addColorStop(0, '#ffffff');
           // set the fill style
           ctx.fillStyle = gradient;
           drawSpectrum(array);

           function drawSpectrum(array) {
               for (var i = 0; i < (array.length); i++) {
                   var value = array[i];
                   ctx.fillRect(i * 5, 325 - value, 3, 325);
               }

           }
       }

       function getAverageVolume(array) {
           var values = 0;
           var average;

           var length = array.length;

           // get all the frequency amplitudes
           for (var i = 0; i < length; i++) {
               values += array[i];
           }

           average = values / length;
           return average;
       }

       // we connect the recorder(node to destination(speakers))
       volume.connect(splitter);
       splitter.connect(analyser, 0, 0);

       analyser.connect(recorder);
       recorder.connect(context.destination);

    }




    function mergeBuffers(channelBuffer, recordingLength) {
       var result = new Float32Array(recordingLength);
       var offset = 0;
       var lng = channelBuffer.length;
       for (var i = 0; i < lng; i++) {
           var buffer = channelBuffer[i];
           result.set(buffer, offset);
           offset += buffer.length;
       }
       return result;
    }

    function interleave(leftChannel, rightChannel) {
       var length = leftChannel.length + rightChannel.length;
       var result = new Float32Array(length);

       var inputIndex = 0;

       for (var index = 0; index < length;) {
           result[index++] = leftChannel[inputIndex];
           result[index++] = rightChannel[inputIndex];
           inputIndex++;
       }
       return result;
    }


    function writeUTFBytes(view, offset, string) {
       var lng = string.length;
       for (var i = 0; i < lng; i++) {

           view.setUint8(offset + i, string.charCodeAt(i));
       }
    }
  • Piwik 2.1 — Massive Performance and Reliability Improvements

    4 mars 2014, par Benaka M. — Community, Development

    We are very excited to announce the immediate availability of Piwik v2.1.0 !

    Piwik 2.1 is the first release after our 2.0 release and it reflects the new direction Piwik is moving in : better performance, more reliability and a better overall open platform ! We also released more plugins on the marketplace as well as helped developers build exciting new plugins for Piwik.

    This 2.1.0 release contains several performance and reliability improvements to the archiving process and to the new device detection process introduced in Piwik 2.0. It also includes a new email report format (CSV), a new marketplace plugin and overall more than 80 improvements (source).

    Massive Performance Improvements to Archiving

    The biggest improvement this release brings to Piwik are the various performance improvements made to the Archiving Process. These improvements include the following :

    • The amount of memory used has been reduced in some cases by 80% or more ! What used to require 8GB of memory will now only require 1GB. Piwik engineers analysed Profiler XHProf reports of Piwik under high load and implemented several improvements to archiving.
    • The cron script you can setup to automatically process your reports will now create new processes to perform asynchronous archiving instead issuing CURL http requests. This change results in increases to the performance and reliability of the Archiving Process.

    Bug Fixes and Performance Improvements to Device Detection

    In Piwik 1.12 we introduced a new device detection feature that could detect much more information than what we used before. Piwik 2.1 includes several bug fixes and improvements to this feature (such as detecting dozens of new devices, brands and models for smartphones, tablets and other devices). To use this feature, go to “Settings” then “Plugins” then activate the DevicesDetection plugin.

    New Default MySQL Database Type (InnoDB)

    This change doesn’t affect our existing Piwik users, but it does reflect our commitment to performance and reliability. We’ve changed the default MySQL database type to be InnoDB instead of Myisam. This will allow new users to immediately gain the benefits in reliability offered by InnoDB.

    New Marketplace Plugin – HTTP Authentication

    We’re releasing a new plugin on the marketplace that will allow you to use the HTTP authentication services provided by your webserver. Learn more about this plugin on the marketplace.

    New Email Format for Scheduled Reports

    The last big change in this release is a new email report format. You can now get your email reports as CSV files as well as HTML and PDF reports.

    Other Improvements

    In addition to performance improvements and new plugins, this release contains a few other smaller improvements described below.

    Changing segments in the Embedded Dashboard

    The embedded dashboard is the powerful feature that lets you include the Piwik Dashboard without the top menu and Piwik branding, directly within your application !

    This dashboard will now include the segment selector allowing you to change the current segment and create new segments, just as you would in the normal dashboard view :

    Embedded Dashboard

    Multiple Super Users

    It’s now possible for your Piwik to have more than one Super User and for Super Users to have aliases :

    Super User Access

    Learn more in the User guide : Managing Super Users in Piwik.

    Smart App Banners for our Mobile Apps

    Finally, in accord with our commitment to providing great User Experience, we’ve added a smart banner to Piwik so users that view Piwik from a mobile device will be informed of our amazing (and free !) mobile apps (for both iOS and Android).

    Participate in Piwik

    Are you a talented developer or an experienced User Interface designer ? If you have some free time and if you want to contribute to one of the most awesome open source projects around, please get in touch with the Piwik team, or read this page to learn more ?

    Summary

    For the full list of changes in Piwik 2.1 check out the Changelog.

    Thank you to the core developers, all the beta testers and users, our official supporters, the translators & everyone who reported bugs or feature requests. Also thank you to the software we use, and the libraries we use.

    Many of the improvements in this release come from the efforts of Piwik PRO experts. If you are looking for help to make the most of your analytics data, contact Piwik PRO. Learn more about us here.

    If you like what you read, please tell your friends and colleagues or write on your website, blog, forums, stackoverflow, etc.

    Enjoy !

  • Piwik 2.1 — Massive Performance and Reliability Improvements

    4 mars 2014, par Benaka M. — Community, Development

    We are very excited to announce the immediate availability of Piwik v2.1.0 !

    Piwik 2.1 is the first release after our 2.0 release and it reflects the new direction Piwik is moving in : better performance, more reliability and a better overall open platform ! We also released more plugins on the marketplace as well as helped developers build exciting new plugins for Piwik.

    This 2.1.0 release contains several performance and reliability improvements to the archiving process and to the new device detection process introduced in Piwik 2.0. It also includes a new email report format (CSV), a new marketplace plugin and overall more than 80 improvements (source).

    Massive Performance Improvements to Archiving

    The biggest improvement this release brings to Piwik are the various performance improvements made to the Archiving Process. These improvements include the following :

    • The amount of memory used has been reduced in some cases by 80% or more ! What used to require 8GB of memory will now only require 1GB. Piwik engineers analysed Profiler XHProf reports of Piwik under high load and implemented several improvements to archiving.
    • The cron script you can setup to automatically process your reports will now create new processes to perform asynchronous archiving instead issuing CURL http requests. This change results in increases to the performance and reliability of the Archiving Process.

    Bug Fixes and Performance Improvements to Device Detection

    In Piwik 1.12 we introduced a new device detection feature that could detect much more information than what we used before. Piwik 2.1 includes several bug fixes and improvements to this feature (such as detecting dozens of new devices, brands and models for smartphones, tablets and other devices). To use this feature, go to “Settings” then “Plugins” then activate the DevicesDetection plugin.

    New Default MySQL Database Type (InnoDB)

    This change doesn’t affect our existing Piwik users, but it does reflect our commitment to performance and reliability. We’ve changed the default MySQL database type to be InnoDB instead of Myisam. This will allow new users to immediately gain the benefits in reliability offered by InnoDB.

    New Marketplace Plugin – HTTP Authentication

    We’re releasing a new plugin on the marketplace that will allow you to use the HTTP authentication services provided by your webserver. Learn more about this plugin on the marketplace.

    New Email Format for Scheduled Reports

    The last big change in this release is a new email report format. You can now get your email reports as CSV files as well as HTML and PDF reports.

    Other Improvements

    In addition to performance improvements and new plugins, this release contains a few other smaller improvements described below.

    Changing segments in the Embedded Dashboard

    The embedded dashboard is the powerful feature that lets you include the Piwik Dashboard without the top menu and Piwik branding, directly within your application !

    This dashboard will now include the segment selector allowing you to change the current segment and create new segments, just as you would in the normal dashboard view :

    Embedded Dashboard

    Multiple Super Users

    It’s now possible for your Piwik to have more than one Super User and for Super Users to have aliases :

    Super User Access

    Learn more in the User guide : Managing Super Users in Piwik.

    Smart App Banners for our Mobile Apps

    Finally, in accord with our commitment to providing great User Experience, we’ve added a smart banner to Piwik so users that view Piwik from a mobile device will be informed of our amazing (and free !) mobile apps (for both iOS and Android).

    Participate in Piwik

    Are you a talented developer or an experienced User Interface designer ? If you have some free time and if you want to contribute to one of the most awesome open source projects around, please get in touch with the Piwik team, or read this page to learn more ?

    Summary

    For the full list of changes in Piwik 2.1 check out the Changelog.

    Thank you to the core developers, all the beta testers and users, our official supporters, the translators & everyone who reported bugs or feature requests. Also thank you to the software we use, and the libraries we use.

    Many of the improvements in this release come from the efforts of Piwik PRO experts. If you are looking for help to make the most of your analytics data, contact Piwik PRO. Learn more about us here.

    If you like what you read, please tell your friends and colleagues or write on your website, blog, forums, stackoverflow, etc.

    Enjoy !