Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (74)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

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

Sur d’autres sites (9103)

  • C# How do I set the volume of sound bytes[]

    23 juillet 2016, par McLucario

    Im trying to change the volume of sound bytes[] in C#. Im reading a sound file with FFMPEG and and wanna change the volume on the fly. I found some examples and but I didnt understand them.

    public void SendAudio(string pathOrUrl)
    {
       cancelVid = false;
       isPlaying = true;

       mProcess = Process.Start(new ProcessStartInfo
       { // FFmpeg requireqs us to spawn a process and hook into its stdout, so we will create a Process
           FileName = "ffmpeg",
           Arguments = "-i " + (char)34 + pathOrUrl + (char)34 + // Here we provide a list of arguments to feed into FFmpeg. -i means the location of the file/URL it will read from
           " -f s16le -ar 48000 -ac 2 pipe:1", // Next, we tell it to output 16-bit 48000Hz PCM, over 2 channels, to stdout.
           UseShellExecute = false,
           RedirectStandardOutput = true, // Capture the stdout of the process
           Verb = "runas"
       });

       while (!isRunning(mProcess)) { Task.Delay(1000); }

       int blockSize = 3840; // The size of bytes to read per frame; 1920 for mono
       byte[] buffer = new byte[blockSize];
       byte[] gainBuffer = new byte[blockSize];
       int byteCount;

       while (true && !cancelVid) // Loop forever, so data will always be read
       {
           byteCount = mProcess.StandardOutput.BaseStream // Access the underlying MemoryStream from the stdout of FFmpeg
           .Read(buffer, 0, blockSize); // Read stdout into the buffer

           if (byteCount == 0) // FFmpeg did not output anything
               break; // Break out of the while(true) loop, since there was nothing to read.

           if (cancelVid)
               break;

           disAudioClient.Send(buffer, 0, byteCount); // Send our data to Discord
       }
       disAudioClient.Wait(); // Wait for the Voice Client to finish sending data, as ffMPEG may have already finished buffering out a song, and it is unsafe to return now.
       isPlaying = false;
       Console.Clear();
       Console.WriteLine("Done Playing!");
  • Jupyter Notebook JSONDecodeError to open file

    25 février 2021, par potterykid

    Expected behavior :
open a mp3 with no error

    


    Actual behavior :
I used the script below,

    


    from pydub
import AudioSegment

    


    song = AudioSegment.from_mp3("audio.mp3")

    


    and there is a JSONDecodeError

    


    JSONDecodeError : Expecting value : line 1 column 1 (char 0)

    


    JSONDecodeError                           Traceback (most recent call last)&#xA; in <module>&#xA;   6 dst = "research.wav"&#xA;   7 &#xA;----> 8 sound = AudioSegment.from_mp3(src)&#xA;   9 sound.export(dst, format = "wav")&#xA;&#xA;~/opt/anaconda3/lib/python3.8/site-packages/pydub/audio_segment.py in from_mp3(cls, file, parameters)&#xA; 736     @classmethod&#xA; 737     def from_mp3(cls, file, parameters=None):&#xA;--> 738         return cls.from_file(file, &#x27;mp3&#x27;, parameters=parameters)&#xA; 739 &#xA; 740     @classmethod&#xA;&#xA;~/opt/anaconda3/lib/python3.8/site-packages/pydub/audio_segment.py in from_file(cls, file, format, codec, parameters, **kwargs)&#xA; 683             info = None&#xA; 684         else:&#xA;--> 685             info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)&#xA; 686         if info:&#xA; 687             audio_streams = [x for x in info[&#x27;streams&#x27;]&#xA;&#xA;~/opt/anaconda3/lib/python3.8/site-packages/pydub/utils.py in mediainfo_json(filepath, read_ahead_limit)&#xA; 277     stderr = stderr.decode("utf-8", &#x27;ignore&#x27;)&#xA; 278 &#xA;--> 279     info = json.loads(output)&#xA; 280 &#xA; 281     if not info:&#xA;&#xA;~/opt/anaconda3/lib/python3.8/json/__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)&#xA; 355             parse_int is None and parse_float is None and&#xA; 356             parse_constant is None and object_pairs_hook is None and not kw):&#xA;--> 357         return _default_decoder.decode(s)&#xA; 358     if cls is None:&#xA; 359         cls = JSONDecoder&#xA;&#xA;~/opt/anaconda3/lib/python3.8/json/decoder.py in decode(self, s, _w)&#xA; 335 &#xA; 336         """&#xA;--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())&#xA; 338         end = _w(s, end).end()&#xA; 339         if end != len(s):&#xA;&#xA;~/opt/anaconda3/lib/python3.8/json/decoder.py in raw_decode(self, s, idx)&#xA; 353             obj, end = self.scan_once(s, idx)&#xA; 354         except StopIteration as err:&#xA;--> 355             raise JSONDecodeError("Expecting value", s, err.value) from None&#xA; 356         return obj, end&#xA;&#xA;JSONDecodeError: Expecting value: line 1 column 1 (char 0)```&#xA;</module>

    &#xA;

  • Discord.js Music bot "TypeError" when playing audio with dispatcher

    21 février 2020, par Cole Perry

    I’m new to Discord.js and I’m trying to have the bot join a voice channel and play an audio file on my computer. I have been following this guide : https://discord.js.org/#/docs/main/stable/topics/voice . Here is the Index.js page :

    Colesbot.on('message', message=>{
       if (message.content === '/join') {
           // Only try to join the sender's voice channel if they are in one themselves
           if (message.member.voiceChannel) {
               message.member.voiceChannel.join().then(connection => {
                   message.reply('I have successfully connected to the channel!');

                   // To play a file, we need to give an absolute path to it
                   const dispatcher = connection.playFile('C:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\Assets\Glory.mp3');

                   dispatcher.on('end', () => {
                       // The song has finished
                       console.log('Finished playing!');
                     });

                   dispatcher.on('error', e => {
                       // Catch any errors that may arise
                       console.log(e);
                     });

                     dispatcher.setVolume(0.5); // Set the volume to 50%
               }).catch(console.log);
       } else {
           message.reply('You need to join a voice channel first!');
         }
       }
    });
    exports.run = (client, message, args) => {
       let user = message.mentions.users.first || message.author;
    }

    FFMPEG is installed and I have set the environment path for it. When I type FFMPEG in the command line I get the proper response.

    Some have said I need to install the ffmpeg binaries but when I run npm install ffmpeg-binaries I get an error message that is here

    So then I tried installing an older version and I’m now using ffmpeg-binaries@3.2.2-3 but when I type /join I get the error

    [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object