
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (67)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 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 (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (9446)
-
ffmpeg convert wav to mp3 using php variable
17 janvier 2016, par JeffI am working on a php function to upload a .wav and also create an .mp3 version of it in the same folder. So far everything is working how it should except for when I try using :
shell_exec('ffmpeg -i ' . $file_path . '-f mp2 ' . $mp3name);
within the function it isn’t creating the .mp3 in the beats folder.
I tried
shell_exec('ffmpeg -i test.wav -f mp2 test.mp3');
on its own and it worked great.
php Function :
function upload_a_sound($user_id, $file_temp, $file_extn, $name, $uploader, $keywords) {
$timecode = substr(md5(time()), 0, 10);
$mp3name = 'beats/' . $timecode . '.mp3';
$file_path = 'beats/' . $timecode . '.' . $file_extn;
//$date = date('m-d-Y');
move_uploaded_file($file_temp, $file_path);
shell_exec('ffmpeg -i ' . $file_path . '-f mp2 ' . $mp3name);
require ('classAudioFile.php');
$AF = new AudioFile;
$AF->loadFile($file_path);
$AF->visual_width=200;
$AF->visual_height=200;
$AF->visual_graph_color="#c491db";
$AF->visual_background_color="#000000";
$AF->visual_grid=false;
$AF->visual_border=false;
$AF->visual_graph_mode=0;
$AF->getVisualization ('images/song/' . $timecode . '.png');
$imageloc = 'images/song/' . $timecode . '.png';
mysql_query("INSERT INTO `content` VALUES ('', '', '$name', '$uploader', '$keywords', '$file_path', '$imageloc', '$mp3name')");
} -
Mimic Audacity amplification with Pydub
16 août 2022, par UnisionzzFor my music library I have used Audacity for recent years to amplify the music to similar levels of loudness ; technically speaking this is not completely true, but for me it is sufficient. However, as it is tedious to do this all by hand, I decided to write a Python code to automate this process for me. The code after the imported package(s) and defined functions will run in a loop in which the filename changes depending on which song is processed.


The difficult part is that I have not yet been able to find a consistent way to amplify different songs so that when the output files are put through Audacity, it will not want to change the amplitude by more than 0.1 dB(FS).


Below are two attempts which seem to have come closest to the desirable output ; other methods that I have tried were either less succesfull or resulted in clipping.


The first attempt finds the maximum dBFS of the song and then applies a gain in order for the maximum dBFS to equal 0 (I have also tried this method with
sound.dBFS
andsound.apply_gain
, but results seem more mixed than the attempt below) :

from pydub import AudioSegment

def change_amplitude(sound, target_dBFS):
 change_in_dBFS = target_dBFS - sound.max_dBFS
 return sound.apply_gain_stereo(change_in_dBFS)

# Audio is gathered from a hard coded path
s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")
amp_s = change_amplitude(s, 0)
amp_s.export(Dir+filename+".mp3", format = "mp3")



The second attempt finds the amplitude and the maximum allowable amplitude (before clipping), recalculates both to dB and then adds the
dB_diff
to the sound :

import numpy as np
from pydub import AudioSegment

s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")

# Get dB amplitude of song and maximum allowable value
dB_sound = 20*np.log10(s.max)
dB_max = 20*np.log10(s.max_possible_amplitude)
dB_diff = dB_max - dB_sound

amp_sound = s + dB_diff



Summarizing, I would like to import a music file, amplify it similar to Audacity amplification and then export the file again.


-
Trouble with converting webm into mp3 with pydub in python
15 août 2020, par rc_martyso basically I want to convert song what I downloaded from youtube in webm and convert to into mp3


when I wanted export song just with
song.export("neco.mp3")
it didn't work too

I have in workfolder ffmpeg.exe and ffprobe.exe


here is the code


from pydub import AudioSegment

song = AudioSegment.from_file(downloaded.webm,"webm")
print("Loaded")
song.export("neco.mp3", format="mp3", bitrate="320k")
print("Converted and saved")



here is the output of the console


Loaded
Traceback (most recent call last):
 File "e:/martan/projekty/Python/programek na pisnicky/songDownloader.py", line 188, in <module>
 song.export("neco.mp3", format="mp3", bitrate="320k")
 File "C:\Users\BIBRAIN\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\audio_segment.py", line 911, in export
 raise CouldntEncodeError(
pydub.exceptions.CouldntEncodeError: Encoding failed. ffmpeg/avlib returned error code: 1

Command:['ffmpeg', '-y', '-f', 'wav', '-i', 'C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpo20ooz_z', '-b:a', '320k', '-f', 'mp3', 'C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpiqpl57g7']

Output from ffmpeg/avlib:

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 10.2.1 (GCC) 20200726
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'C:\Users\BIBRAIN\AppData\Local\Temp\tmpo20ooz_z':
 Duration: 00:03:54.71, bitrate: 3072 kb/s
 Stream #0:0: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 3072 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (pcm_s32le (native) -> mp3 (mp3_mf))
Press [q] to stop, [?] for help
[mp3_mf @ 00000000004686c0] could not find any MFT for the given media type
[mp3_mf @ 00000000004686c0] could not create MFT
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
</module>


I think it is something with codec but I have no idea what to do