Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (86)

  • 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 (...)

  • 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 (9129)

  • Using ffmpeg with an audio input from System.IO.Stream

    17 juillet 2020, par kevingoos

    So I am creating a project where I need to convert audio comming from azure text to speech.
    
I wanted to use ffmpeg for this, but I am not an expert with all these parameters.
So far I alread got it working where I read from a $.wav file and convert it to an output System.IO.Stream comming from ffmpeg.

    


    But I want to change it that I don't always save a wav file to disk. Instead now I get a System.IO.Stream from azure text to speech, but I have no clue for the params and the documentation is not really clear for me...

    


    var azureAudio = await new AzureSpeechService().Speak(text);

var psi = new ProcessStartInfo
{
    FileName = @"C:\ffmpeg-20200715-a54b367-win64-static\bin\ffmpeg.exe",
    Arguments = "-i pipe:0 -ac 2 -f s16le -ar 48000 pipe:1",
    RedirectStandardOutput = true,
    UseShellExecute = false
};
var ffmpeg = Process.Start(psi);

var inputStream = ffmpeg.StandardInput.BaseStream;

azureAudio.CopyTo(inputStream);

inputStream.Flush();
inputStream.Close();

var outputStream = ffmpeg.StandardOutput.BaseStream;
await SendAudioAsync(client, outputStream);


    


  • Assign output of subprocess to variable

    21 juillet 2016, par Bryan

    The purpose of this script is to read a file, extract the audio, and print out a transcript by running it through IBM Watson speech to text API. My problem is when I try to save the output from the subprocess into a variable and pass it into the open function, it reads as binary. What am I doing wrong ? Any help would be appreciated !

    import sys
    import re
    import json
    import requests
    import subprocess
    from subprocess import Popen, PIPE

    fullVideo = sys.argv[1]
    title = re.findall('^([^.]*).*', fullVideo)
    title = str(title[0])
    output = subprocess.Popen('ffmpeg -i ' + fullVideo + ' -vn -ab 128k ' + title + '.flac', shell = True, stdin=subprocess.PIPE).communicate()[0]

    sfile= open(output, "rb")
    response = requests.post("https://stream.watsonplatform.net/speech-to-text/api/v1/recognize",
            auth=("USERNAME", "PASSWORD"),
            headers = {"content-type": "audio/flac"},
            data=sfile
            )

    print (json.loads(response.text))
  • NodeJS SpeechRecorder pipe to child process ffmpeg encoder - dest.on is not a function

    10 décembre 2022, par Matthew Swaringen

    Trying to make a utility to help me with recording words for something. Unfortunately getting stuck on the basics.

    


    The error I get when I hit s key and talk enough to fill the buffer is

    


    terminate called after throwing an instance of 'Napi::Error'
  what():  dest.on is not a function
[1]    2298218 IOT instruction (core dumped)  node record.js


    


    Code is below. I can write the wav file and then encode that but I'd rather not have to have an intermediate file unless there is no way around it, and I can't imagine that is the case.

    


    const { spawn } = require('child_process');
const { writeFileSync } = require('fs');
const readline = require('readline');
const { SpeechRecorder } = require('speech-recorder');
const { WaveFile } = require('wavefile');

let paused = true;

const ffmpeg = spawn('ffmpeg', [
 // '-f', 's16', // input format
  //'-sample_rate', '16000',
  '-i', '-', // input source
  '-c:a', 'libvorbis', // audio codec  
  'output.ogg', // output file  
  '-y'
]);

let buffer = [];
const recorder = new SpeechRecorder({
  onAudio: ({ audio, speech }) => {
    //if(speech) {

      for (let i = 0; i < audio.length; i++) {
        buffer.push(audio[i]);
      }

      if(buffer.length >= 16000 * 5) { 
        console.log('piping to ffmpeg for output');
        let wav = new WaveFile()
        wav.fromScratch(1,16000,"16",buffer);
        //writeFileSync('output.wav',wav.toBuffer());
        ffmpeg.stdin.pipe(buffer, {end: false});
      }
    //}
  }
});

// listen for keypress events
readline.emitKeypressEvents(process.stdin);
process.stdin.setRawMode(true);

process.stdin.on('keypress', (str, key) => {
  if (key.name === 's') {
    // pause or resume recording
    paused = !paused;
    if(paused) { recorder.stop(); } else { recorder.start(); }

   
  } else if (key.ctrl && key.name === 'c') {
    // exit program
    ffmpeg.kill('SIGINT');    
    process.exit();
  }
});