
Recherche avancée
Médias (1)
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (102)
-
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 (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (9399)
-
Google Speech API - Is there a way to determine if the audio has human voice or not ?
20 décembre 2019, par stupid_smaI am making an audio filtering application at work that reads over hundreds of audio files and filters them. So, if the audio has human voice in it, it will accept it and if it does not- it will delete the audio file.
I am using ffmpeg to get the details of the audio and add other filters like size and duration and silence (though it is not very accurate in detecting silence for all audio files.)
My company asked me to try the Google Cloud Speech API to detect if the audio has any human voice in it.
So with this code, some audio files return a Transcript of spoken words in the audio file, but what I need is to determine if a human is speaking or not.
I have considered using hark.js for it but there does not seem to be enough documentation and I am short on time !
Ps. I am an intern and I’m just starting out with programming. I apologize if my question does not make sense or sounds dumb.
# Includes the autoloader for libraries installed with composer
require __DIR__ . '/vendor/autoload.php';
# Imports the Google Cloud client library
use Google\Cloud\Speech\V1\SpeechClient;
use Google\Cloud\Speech\V1\RecognitionAudio;
use Google\Cloud\Speech\V1\RecognitionConfig;
use Google\Cloud\Speech\V1\RecognitionConfig\AudioEncoding;
putenv('GOOGLE_APPLICATION_CREDENTIALS=../../credentials.json');
echo getcwd() . "<br />";
chdir('test-sounds');
echo getcwd() . "<br />";
echo shell_exec('ls -lr');
$fileList = glob('*');
foreach($fileList as $filename){
//echo $filename, '<br />';
# The name of the audio file to transcribe
$audioFile = __DIR__ . '/' . $filename;
# get contents of a file into a string
$content = file_get_contents($audioFile);
# set string as audio content
$audio = (new RecognitionAudio())
->setContent($content);
# The audio file's encoding, sample rate and language
$config = new RecognitionConfig([
'encoding' => AudioEncoding::LINEAR16,
'language_code' => 'ja-JP'
]);
# Instantiates a client
$client = new SpeechClient();
# Detects speech in the audio file
$response = $client->recognize($config, $audio);
# Print most likely transcription
foreach ($response->getResults() as $result) {
$alternatives = $result->getAlternatives();
$mostLikely = $alternatives[0];
$transcript = $mostLikely->getTranscript();
printf('<br />Transcript: %s' . PHP_EOL, $transcript . '<br />');
}
$client->close();
}
?> ``` -
Automating removal of voice in audio files
28 octobre 2014, par timohteyI wish to remove the voices found in audio files (e.g. Movie shots, soundtracks). Currently I’m using Audacity to remove the voices manually but I want to automate it since I’m removing voices from a lot of audio files.
I know this post is kind of redundant but I was hoping that there are new tools out there that you guys could suggest. Any suggestions ?
-
How can I merge discord voice streams ?
3 mars 2023, par LeGlaudeI'd like to merge the voice of users that I receive using the discordjs/voice library. The number of streams to merge has to be flexible. Also, The output stream has to be readable so I can use it as a source.


I tried different libraries like fluent-ffmpeg, ffmpeg and merge-stream. My discord bot didn't crash when I was using fluent-ffmpeg to merge n streams but no sound was streamed. Sadly, I don't have my previous code when I used fluent-ffmpeg. I have my code that uses merge-stream. The problem with merge-stream is that when I try to merge streams it says "TypeError : source.once is not a function". Here is my code :


async function CreateStream(server_id) {
 let users = client.channels.cache.get(GetVoiceChannel(server_id)).members.map(user => user.id)
 if (users.indexOf(bot_id) != -1) {
 users.splice(users.indexOf(bot_id), bot_id)
 };

 console.log(users)

 const connection1 = getVoiceConnection(server_id)
 const connection2 = getVoiceConnection(GetCall(server_id))

 const streams = []

 for (const user in users) {
 const sub = connection1.receiver.subscribe(user, { end: EndBehaviorType.Manual })
 streams.push(sub)
 }

 const theStream = merge()

 for (const stream in streams) {
 theStream.add(stream)
 }

 const resource = createAudioResource(theStream, {inputType: StreamType.Opus})
 const player = createAudioPlayer()

 connection2.subscribe(player);
 player.play(resource);
 
}



EDIT :


Now this is my code :



async function CreateStream(server_id) {
 let users = client.channels.cache.get(GetVoiceChannel(server_id)).members.map(user => user.id)
 if (users.indexOf(bot_id) != -1) {
 users.splice(users.indexOf(bot_id), bot_id)
 };

 const connection1 = getVoiceConnection(server_id)
 const connection2 = getVoiceConnection(GetCall(server_id))

 let merge_param = []

 for (const user in users) {
 const sub = connection1.receiver.subscribe(user, { end: EndBehaviorType.Manual })
 merge_param.push('-i')
 merge_param.push(sub)
 }

 merge_param.push('-','-sample_fmt', 's16', '-ar', '48000','-ac', 2, '-acodec', 'libopus','-b:a', '192k', '-vbr', 'on', '-compression_level', '10', '-f', 'opus', 'pipe:1')

 const ffmpeg = cp.spawn('ffmpeg', merge_param);

 const resource = createAudioResource(ffmpeg.stdout, {inputType: StreamType.Opus})
 const player = createAudioPlayer()

 connection2.subscribe(player);
 player.play(resource);
 
}




I don't have an error anymore but no sound is coming out from the bot.