Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (104)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (11814)

  • Can anyone help me with the errors ?

    11 juillet 2017, par joel

    I am a newbie to ffmpeg module. Here is my code to read audio wave files using ffmpeg and pipe.

    import numpy as np
    import subprocess as sp
    import os
    from os.path import join
    from multiprocessing import Pool
    smpler=44100
    files= list()


    for roots, dirs, filek in os.walk("/home/joel/pymusic/mu2"):
       for fi in filek:
         files.append(os.path.join("/home/joel/pymusic/mu2",fi))


    def load(filename,in_typ=np.int16,out_typ=np.float32):
      channels=1
      form={
      np.int16:'s16le'
        }
      f_s= form[in_typ]
      command=[
        'ffmpeg',
        '-i',filename,
        '-f',f_s,
        '-acodec', 'pcm_' + f_s,
        '-ar', str(smpler),
        '-ac',str(channels),'-']
      raw=b' '
      pi=sp.Popen(command, stdout=sp.PIPE, bufsize=4096)
      read_c= smpler*channels*16
      while True:
       data= pi.stdout.read(read_c )
       if data:
           raw += data
       else:
           break
      audio= np.fromstring(raw, dtype=np.int16).astype(np.float32)
      return audio
    def helper(f):
         return(load(f))
    p= Pool()
    array= p.map(helper, files)
    p.close()
    p.join()

    Where files is a list consisting of 20 audio wave files.
    I’m getting the error as :

    >File "prj2.py", line 42, in <module>
    >      array= p.map(helper, files)
    >File "/usr/lib/python2.7/multiprocessing/pool.py", line 251, in map
    >     return self.map_async(func, iterable, chunksize).get()
    >File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
    >     raise self._value
    >ValueError: string size must be a multiple of element size
    </module>

    Can anyone help me out with these errors ?

  • The problem with the AudioDispatcher, the analysis in audioDispatcherFactory is not running, TarsosDSP

    4 février, par roman_gor_

    I'm making an application for sound analysis and spotlight control. The colors of the spotlight change to the beat of the music. I use the TarsosDSP library for this, additionally downloaded the FFmpeg-Kit library to convert audio to WAV format, PCM 16L to work with audioDispatcher.&#xA;The problem is that when audio is transmitted in the correct format, dispatcher starts and immediately ends. The boolean Process method is not executed, but the process Finished() method is executed. I found out that the stream starts, the file is not empty, it is converted to the correct format, BUT the getFrameLength() method, when interacting with the AudioStream to which I pass the filePath, returns the file path value -1, that is, in fact, it is not filled in. I've already searched through everything, and the github library code, and all the neural networks, I don't know how to solve this issue. The problem is with AudioDispatcher and AudioDispatcherFactory.from Pipe() ?

    &#xA;

    private void playAndAnalyzeAudio(String filePath, Uri uri)&#xA;    {&#xA;        if (mediaPlayer != null)&#xA;            mediaPlayer.release();&#xA;        mediaPlayer = MediaPlayer.create(requireContext(), uri);&#xA;&#xA;        new Thread(() -> {&#xA;            extractAudio(inputFilePath, outputFilePath);&#xA;            getActivity().runOnUiThread(() -> {&#xA;                mediaPlayer = MediaPlayer.create(requireContext(), uri);&#xA;                if (mediaPlayer != null) {&#xA;                    mediaPlayer.start(); // Start music after analyze&#xA;                    startSendingData(); // Start data sending&#xA;                }&#xA;            });&#xA;        }).start();&#xA;    }&#xA;&#xA;    private void analyzeAudio(String filePath)&#xA;    {&#xA;        try {&#xA;            AudioDispatcher audioDispatcher = AudioDispatcherFactory.fromPipe(filePath, 44100, 1024, 0);&#xA;            MFCC mfcc = new MFCC(1024, 44100, 13, 50, 20, 10000);&#xA;            audioDispatcher.addAudioProcessor(mfcc);&#xA;            Log.d("AUDIO_ANALYSIS", "Начинаем анализ аудиофайла..." &#x2B; audioDispatcher);&#xA;            audioDispatcher.addAudioProcessor(new AudioProcessor() {&#xA;                @Override&#xA;                public boolean process(AudioEvent audioEvent) {&#xA;                    Log.d("AUDIO_ANALYSIS", "Обрабатываем аудио...");&#xA;&#xA;                    float[] amplitudes = audioEvent.getFloatBuffer();&#xA;                    Log.d("AUDIO_ANALYSIS", "Размер буфера: " &#x2B; amplitudes.length);&#xA;&#xA;                    float[] mfccs = mfcc.getMFCC();&#xA;                    if (mfccs == null) {&#xA;                        Log.e("AUDIO_ANALYSIS", "MFCC не сгенерировался!");&#xA;                        return true;&#xA;                    }&#xA;&#xA;                    float currentBass = mfccs[0] &#x2B; mfccs[1];&#xA;                    float totalEnergy = 0;&#xA;                    for (float amp : amplitudes) {&#xA;                        totalEnergy &#x2B;= Math.abs(amp);&#xA;                    }&#xA;&#xA;                    Log.d("AUDIO_ANALYSIS", "Bass Energy: " &#x2B; currentBass &#x2B; ", Total Energy: " &#x2B; totalEnergy);&#xA;&#xA;                    if (currentBass > BASS_THRESHOLD || totalEnergy > ENERGY_THRESHOLD) {&#xA;                        changeColor();&#xA;                        Log.d("SONG", "Color wac changed on a : " &#x2B; currentColor);&#xA;                        brightness = MAX_BRIGHTNESS;&#xA;                    } else {&#xA;                        brightness *= 0.9f;&#xA;                    }&#xA;&#xA;                    return true;&#xA;                }&#xA;&#xA;                @Override&#xA;                public void processingFinished() {&#xA;                    getActivity().runOnUiThread(() -> Toast.makeText(requireContext(), "Анализ завершён", Toast.LENGTH_SHORT).show());&#xA;                }&#xA;            });&#xA;            File file = new File(filePath);&#xA;            if (!file.exists() || file.length() == 0) {&#xA;                Log.e("AUDIO_ANALYSIS", "Error: file is empty! " &#x2B; filePath);&#xA;                return;&#xA;            } else {&#xA;                Log.d("AUDIO_ANALYSIS", "File is, size: " &#x2B; file.length() &#x2B; " byte.");&#xA;            }&#xA;            Log.d("AUDIO_ANALYSIS", "Start of analyzing: " &#x2B; filePath);&#xA;            File ffmpegFile = new File(getContext().getCacheDir(), "ffmpeg");&#xA;            if (!ffmpegFile.setExecutable(true)) {&#xA;                Log.e("AUDIO_ANALYSIS", "You don&#x27;t have any roots for ffmpeg!");&#xA;            }&#xA;            else&#xA;                Log.e("AUDIO_ANALYSIS", "You have roots for ffmpeg!");&#xA;&#xA;            new Thread(() -> {&#xA;                Log.d("AUDIO_ANALYSIS", "Start dispatcher...");&#xA;                audioDispatcher.run();&#xA;                Log.d("AUDIO_ANALYSIS", "Dispatcher end.");&#xA;            }).start();&#xA;        } catch (Exception e) {&#xA;            e.printStackTrace();&#xA;            Toast.makeText(requireContext(), "Error of analyzing", Toast.LENGTH_SHORT).show();&#xA;        }&#xA;    }&#xA;public void extractAudio(String inputFilePath, String outputFilePath) {&#xA;        File outputFile = new File(outputFilePath);&#xA;        if (outputFile.exists()) {&#xA;            outputFile.delete();  // Удаляем существующий файл&#xA;        }&#xA;        // Строим команду для извлечения аудио&#xA;        String command = "-i " &#x2B; inputFilePath &#x2B; " -vn -acodec pcm_s16le -ar 44100 -ac 2 " &#x2B; outputFilePath;&#xA;&#xA;        // Используем FFmpegKit для выполнения команды&#xA;        FFmpegKit.executeAsync(command, session -> {&#xA;            if (session.getReturnCode().isSuccess()) {&#xA;                Log.d("AUDIO_EXTRACT", "Аудио извлечено успешно: " &#x2B; outputFilePath);&#xA;                analyzeAudio(outputFilePath);  // Продолжаем анализировать аудио&#xA;            } else {&#xA;                Log.e("AUDIO_EXTRACT", "Ошибка извлечения аудио: " &#x2B; session.getFailStackTrace());&#xA;            }&#xA;        });&#xA;    }&#xA;

    &#xA;

    Sorry about the number of lines, i tried to describe the problem very detailed.&#xA;I tried to change AudioDispatcherFactory.fromPipe() on a AudioDispatcherFactory.fromFile(), but this method don't available in Android, only in Java, how i see the error "Javax.sound..., unexpected error, method don't available"&#xA;I tried to change String command in executeAudio() method, to change arguments of fromPipe() method, but in did not to bring success.&#xA;I want that my audio file will be correct analyze with audiodispatcher and then, that data from analyze will be transfered to arduino. Now in Logs I see "Color : null, value : 0.0.

    &#xA;

  • Anomalie #4052 (Nouveau) : Visualiser ses messages dans le privé

    28 novembre 2017, par tcharlss (*´_ゝ`)

    Dans la page infos_perso du privé (ou sur sa page d’auteur), il y a un lien dans la boîte d’infos qui mène vers controler_forum, avec le nombre de contributions : « N messages de forum ».

    Intuitivement on s’attendrait à ce que le lien nous mène vers une page qui montre nos messages, mais ce n’est pas le cas, on les voit tous.
    Je propose de rajouter id_auteur=N au lien.

    Ensuite sur cette page, la gestion des auteurs est un inconsistente avec le reste.
    À la base les liens pour filtrer les messages et les boutons d’actions sont situés dans la boîte de raccourcis à gauche.
    En revanche il n’y a pas moyen de filtrer ses propres messages (à part manuellement en ajoutant id_auteur dans l’URL), et une fois qu’un auteur est sélectionné, l’info apparaît dans une boîte au dessus de la liste, au lieu d’utiliser la boîte de raccourcis à gauche. Donc l’interface permet de « défiltrer » par auteur mais pas de filtrer.

    Je propose donc d’ajouter un filtre « mes messages » dans la boîte de raccourcis.