
Recherche avancée
Autres articles (47)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...)
Sur d’autres sites (3961)
-
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.


-
Discord Voice Bot cannot play the audio file
7 avril 2023, par Jakub NawrockiI tried to write a bot that will join the voice channel and play a audio at 20:00.


Currently the bot joins the channel, but immediately after that it disconnects without making a single sound with this message :


2023-04-07 17:58:01 INFO discord.player ffmpeg process 18258 has not terminated. Waiting to terminate... 2023-04-07 17:58:01 INFO discord.player ffmpeg process 18258 should have terminated with a return code of -9. 2023-04-07 17:58:01 INFO discord.voice_client The voice handshake is being terminated for Channel ID 1093533451778523241 (Guild ID 1093533451778523237) 2023-04-07 17:58:01 INFO discord.voice_client Disconnecting from voice normally, close code 1000. Audio file loaded: Audio could not be played:


Code :


import discord
import asyncio
import datetime

TOKEN = 'TOKEN HERE' 
CHANNEL_ID = CHANNEL ID HERE

client = discord.Client(intents=discord.Intents.all())

async def play_sound(voice_client):
 try:
 source = discord.FFmpegPCMAudio('audio.mp3')
 print(f"Audio file loaded: {source}")
 voice_client.play(source)
 while voice_client.is_playing():
 await asyncio.sleep(1)
 except Exception as e:
 print(f"Audio could not be played: {e}")

@client.event
async def on_ready():
 print('Bot is ready')
 now = datetime.datetime.now()
 target_time = datetime.time(hour=20, minute=00)
 if now.time() >= target_time:
 print(f"Current time: {now.time()}. Bot did not join channel.")
 return
 else:
 print(f"Current time: {now.time()}. Bot has joined at {target_time}.")
 await asyncio.sleep((datetime.datetime.combine(datetime.date.today(), target_time) - now).total_seconds())
 channel = client.get_channel(CHANNEL_ID)
 if channel is not None:
 try:
 voice_client = await channel.connect()
 print(f'{client.user} joined voice chat.')
 await asyncio.sleep(1)
 await play_sound(voice_client)
 await voice_client.disconnect()
 print(f'{client.user} left voice chat.')
 except Exception as e:

 print(f"Error during joining channel : {e}")
 else:
 print(f"Did not find a channel of ID {CHANNEL_ID}.")

client.run(TOKEN)



Any ideas ?


ffmpeg has been installed properly.


-
discordjs/voice : Changing volume does not have any effect
27 avril 2023, par CoxcopiI'm using @discordjs/voice for a bot. When I try to change the audio volume of a resource, no matter if it's while the resource is being played currently or if I do it before playing it, it doesn't seem to have any effect.


My code for creating the resource looks like this :


const stream = ytdl(url, {
 filter: "audioonly",
 format: "mp3",
 highWaterMark: 1 << 62,
 liveBuffer: 1 << 62,
 dlChunkSize: 0,
 bitrate: 128,
 quality: "lowestaudio"
})
const resource = createAudioResource(stream, {inlineVolume: true});



And for changing the volume before playing :


resource.volume.setVolume(audioVolume);
audioPlayer.play(resource);



I've tried
audioVolume
values between 0.0-1.0 as well as between 0-100 but no matter the value, the audio volume stayed exactly the same. Any Ideas what could be the issue here ?