Recherche avancée

Médias (0)

Mot : - Tags -/content

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (24)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (3793)

  • avformat/apetag : account for header size if present when returning the start position

    10 février 2017, par James Almer
    avformat/apetag : account for header size if present when returning the start position
    

    The size field in the header/footer accounts for the entire APE tag
    structure except the 32 bytes from header, for compatibility with
    APEv1.

    Reviewed-by : Paul B Mahol <onemda@gmail.com>
    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] libavformat/apetag.c
    • [DH] libavformat/apetag.h
  • FFMPEG - Overlay WebM over PNG Start Position

    26 avril 2022, par joshuaalvarez

    I am trying to place WebM videos over PNGs layered on top of each other. I have successfully done so, however, the WebM videos are not present in the first frame in the video and are added one frame at a time. For example, if I place 2 WebM videos over a PNG, it will layer one WebM per frame at a time.

    &#xA;

    It may be important to note that I am using PNGs and WebMs as the inputs (WebM to use alpha channel) and exporting as MP4.

    &#xA;

    I am using complex filters and the overlay in this way : overlay=format=auto per image/video.

    &#xA;

    Here is a link to a MP4 that shows my issue. See how there is only the PNG portion in the video at 0:00 and the WebM portions come in shortly after.

    &#xA;

  • Detect volume via mic, start recording, end on silence, transcribe and sent to endpoint

    15 juin 2023, par alphadmon

    I have been attempting to get this to work in many ways but I can't seem to get it right. Most of the time I get a part of it to work and then when I try to make other parts work, I generally break other things.

    &#xA;

    I am intercepting the volume coming from the mic and if it is louder than 50, I start a recording. I then keep recording until there is a silence, if the silence is equal to 5 seconds I then stop the recording.

    &#xA;

    I then send the recording to be transcribed by whisper using OpenAI API.

    &#xA;

    Once that is returned, I then want to send it to the open ai chat end point and get the response.

    &#xA;

    After that, I would like to start listening again.

    &#xA;

    Here is what I have that is sort of working so far, but the recording is an empty file always :

    &#xA;

    // DETECT SPEECH&#xA;const recorder = require(&#x27;node-record-lpcm16&#x27;);&#xA;&#xA;// TRANSCRIBE&#xA;const fs = require("fs");&#xA;const ffmpeg = require("fluent-ffmpeg");&#xA;const mic = require("mic");&#xA;const { Readable } = require("stream");&#xA;const ffmpegPath = require("@ffmpeg-installer/ffmpeg").path;&#xA;require(&#x27;dotenv&#x27;).config();&#xA;&#xA;// CHAT&#xA;const { Configuration, OpenAIApi } = require("openai");&#xA;&#xA;// OPEN AI&#xA;const configuration = new Configuration({&#xA;    organization: process.env.OPENAI_ORG,&#xA;    apiKey: process.env.OPENAI_API_KEY,&#xA;});&#xA;const openai = new OpenAIApi(configuration);&#xA;&#xA;// SETUP&#xA;ffmpeg.setFfmpegPath(ffmpegPath);&#xA;&#xA;// VARS&#xA;let isRecording = false;&#xA;const audioFilename = &#x27;recorded_audio.wav&#x27;;&#xA;const micInstance = mic({&#xA;    rate: &#x27;16000&#x27;,&#xA;    channels: &#x27;1&#x27;,&#xA;    fileType: &#x27;wav&#x27;,&#xA;});&#xA;&#xA;// DETECT SPEECH&#xA;const file = fs.createWriteStream(&#x27;determine_speech.wav&#x27;, { encoding: &#x27;binary&#x27; });&#xA;const recording = recorder.record();&#xA;recording.stream().pipe(file);&#xA;&#xA;&#xA;recording.stream().on(&#x27;data&#x27;, async (data) => {&#xA;    let volume = parseInt(calculateVolume(data));&#xA;    if (volume > 50 &amp;&amp; !isRecording) {&#xA;        console.log(&#x27;You are talking.&#x27;);&#xA;        await recordAudio(audioFilename);&#xA;    } else {&#xA;        setTimeout(async () => {&#xA;            console.log(&#x27;You are quiet.&#x27;);&#xA;            micInstance.stop();&#xA;            console.log(&#x27;Finished recording&#x27;);&#xA;            const transcription = await transcribeAudio(audioFilename);&#xA;            console.log(&#x27;Transcription:&#x27;, transcription);&#xA;            setTimeout(async () => {&#xA;                await askAI(transcription);&#xA;            }, 5000);&#xA;        }, 5000);&#xA;    }&#xA;});&#xA;&#xA;function calculateVolume(data) {&#xA;    let sum = 0;&#xA;&#xA;    for (let i = 0; i &lt; data.length; i &#x2B;= 2) {&#xA;        const sample = data.readInt16LE(i);&#xA;        sum &#x2B;= sample * sample;&#xA;    }&#xA;&#xA;    const rms = Math.sqrt(sum / (data.length / 2));&#xA;&#xA;    return rms;&#xA;}&#xA;&#xA;// TRANSCRIBE&#xA;function recordAudio(filename) {&#xA;    const micInputStream = micInstance.getAudioStream();&#xA;    const output = fs.createWriteStream(filename);&#xA;    const writable = new Readable().wrap(micInputStream);&#xA;&#xA;    console.log(&#x27;Listening...&#x27;);&#xA;&#xA;    writable.pipe(output);&#xA;&#xA;    micInstance.start();&#xA;&#xA;    micInputStream.on(&#x27;error&#x27;, (err) => {&#xA;        console.error(err);&#xA;    });&#xA;}&#xA;&#xA;// Transcribe audio&#xA;async function transcribeAudio(filename) {&#xA;    const transcript = await openai.createTranscription(&#xA;        fs.createReadStream(filename),&#xA;        "whisper-1",&#xA;    );&#xA;    return transcript.data.text;&#xA;}&#xA;&#xA;// CHAT&#xA;async function askAI(text) {&#xA;    let completion = await openai.createChatCompletion({&#xA;        model: "gpt-4",&#xA;        temperature: 0.2,&#xA;        stream: false,&#xA;        messages: [&#xA;            { role: "user", content: text },&#xA;            { role: "system", content: "Act like you are a rude person." }&#xA;        ],&#xA;    });&#xA;&#xA;    completion = JSON.stringify(completion.data, null, 2);&#xA;    console.log(completion);&#xA;}&#xA;

    &#xA;