Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (10)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

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

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (2270)

  • HTML5 icecast stream and pausing stream to add advert

    2 avril 2019, par RussellHarrower

    So I have not found a good solution to add audio advertising to our radio station for users who are not in the stations main area (western Australia).

    So I was wondering is there away that anyone knows of, that would allow a code be it ffmpeg or java/JavaScript to listen for the song that is currently playing (it maybe delayed by 30seconds) and after the song ends start an audio ad from a mongodb database.

    I know how to do the mongodb database part.

    What I need to figure out is how to detect that the song is finishing or other option is to store the stations adverts in the db as raw data or even better we could air a 0.1sec file that is just blank and that filename tells the script to lower audio player ones volume and boost audio two volume.

    When station ads end we play another filename with same length and reverse the process.

    Ok sorry if that’s me thinking out loud but if you have any ideas that would be great.

    The only issue with above is TuneIn app won’t work with an IFrame we need to supply them an audio url.

    So if anyone know how to do this in ffmpeg and only require 1 url which can detect users location that be better solution.

    All ideas welcomed and yes I googled and Bing searched however I don’t have 30,000$ for hardware companies are selling. There has to be an open source solution.

  • Unable to use Multithread for librosa melspectrogram

    15 avril 2019, par Raven Cheuk

    I have over 1000 audio files (it’s just a initial development, in the future, there will be even more audio files), and would like to convert them to melspectrogram.

    Since my workstation has a Intel® Xeon® Processor E5-2698 v3, which has 32 threads, I would like to use multithread to do my job.

    My code

    import os
    import librosa
    from librosa.display import specshow
    from natsort import natsorted
    import numpy as np
    import sys
    # Libraries for multi thread
    from multiprocessing.dummy import Pool as ThreadPool
    import subprocess
    pool = ThreadPool(20)

    songlist = os.listdir('../opensmile/devset_2015/')
    songlist= natsorted(songlist)

    def get_spectrogram(song):
       print("start")
       y, sr = librosa.load('../opensmile/devset_2015/' + song)

       ## Add some function to cut y
       y_list = y
       ##

       for i, y_i in enumerate([y_list]): # can remove for loop if no audio is cut
           S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000)
           try:
               np.save('./Test/' + song + '/' + str(i), S)
           except:
               os.makedirs('./Test/' + song)
               np.save('./Test/' + song + '/' + str(i), S)
           print("done saving")

    pool.map(get_spectrogram, songlist)

    My Problem

    However, my script freezes after finished the first conversion.

    To debug what’s going on, I commented out S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000) and replace it by S=0.
    Then the multi-thread code works fine.

    What’s wrong with the librosa.feature.melspectrogram function ? Does it not support multi-thread ? Or is it a problem of ffmpeg ? (When using librosa, it asks me to install ffmpeg before.)

  • Audio playing back at the wrong speed using FFmpeg on Android

    11 avril 2019, par Kyborg2011

    General problem in the following :
    I decode the audio as follows :

    ReSampleContext* rsc = av_audio_resample_init(
           1, aCodecCtx->channels,
           aCodecCtx->sample_rate, aCodecCtx->sample_rate,
           av_get_sample_fmt("u8"), aCodecCtx->sample_fmt,
           16, 10, 0, 1);

    while (av_read_frame(pFormatCtx, &packet)>= 0) {
       if (aCodecCtx->codec_type == AVMEDIA_TYPE_AUDIO) {
           int data_size = AVCODEC_MAX_AUDIO_FRAME_SIZE * 2;
           int size=packet.size;
           int decoded = 0;

            while(size > 0) {
                int len = avcodec_decode_audio3(aCodecCtx, pAudioBuffer,
                    &data_size, &packet);

                //Сonvert audio to sample 8bit
                out_size = audio_resample(rsc, outBuffer, pAudioBuffer, len);

                jbyte *bytes = (*env)->GetByteArrayElements(env, array, NULL);

                memcpy(bytes, outBuffer, out_size);
                (*env)->ReleaseByteArrayElements(env, array, bytes, 0);
                (*env)->CallStaticVoidMethod(env, cls, mid, array, out_size, number);

                size -= len;
                number++;
            }
        }
    }

    Next release it AudioTrack. After that, I hear that song that was necessary, but with noise and speed of 2 times larger. In what may be the problem ?

    UPDATE :
    This is Java code :

    public static AudioTrack track;
    public static byte[] bytes;
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
       int bufSize = 2048;
       track = new AudioTrack(AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_MONO,
                   AudioFormat.ENCODING_PCM_8BIT, bufSize, AudioTrack.MODE_STREAM);

       bytes = new byte[bufSize];
       Thread mAudioThread = new Thread(new Runnable() {
           public void run() {
               int res = main(2, "/sdcard/muzika_iz_reklami_bmw_5_series_-_bmw_5_series.mp3", bytes);
               System.out.println(res);
           }
       });
       mAudioThread.setPriority(Thread.MAX_PRIORITY);
       mAudioThread.start();
    }

    private static void play(byte[] play, int length, int p) {
       if (p==0){
           track.play();
       }
       track.write(play, 0, length);
    }