
Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (36)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe 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 (...)
Sur d’autres sites (6877)
-
How to watermark on video in android using ffmpeglibrary programmatically
2 mai 2016, par Sakibmohammad SyedI want to watermark one video file using ffmpeg library. I have one png, one mp4 file in my Videokit folder and I want to watermark png image to video file and below is my code but I don’t know why I am unable to watermark on it. I have no more idea about implementation of ffmpeg library so please help me to solve such issue.
Here is my MainActivity.public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String workFolder = "/sdcard/Videokit/";
GeneralUtils.deleteFileUtil(workFolder + "/vk.log");
PowerManager powerManager = (PowerManager) this.getSystemService(Activity.POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VK_LOCK");
wakeLock.acquire();
String commandStr = "ffmpeg -i /sdcard/Videokit/test.mp4 -i /sdcard/Videokit/test.png -filter_complex transpose=1,overlay=10:10 -y /sdcard/out.mp4";
LoadJNI vk = new LoadJNI();
try {
vk.run(GeneralUtils.utilConvertToComplex(commandStr), workFolder, MainActivity.this);
GeneralUtils.copyFileToFolder(commandStr, workFolder);
} catch (CommandValidationException e) {
Log.e("Prefs.TAG", "vk run exeption.", e);
}
}
}Here is my Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.android.compressexample">
<application>
<activity>
<action></action>
<category></category>
</activity>
</application>
</manifest> -
merge (video and sound) with (background music)
27 novembre 2016, par Nir dii have video file vid.mpg that contain video and audio(speaking) and audio file aud.wav that contain background music.
now, i want to merge them together.
here is the command that i use :
ffmpeg -i vid.mpg -i aud.mp3 -c:v copy -filter_complex "[0:a]aformat = fltp:44100:stereo,apad[0a];[1]aformat=fltp:44100:stereo,volume=0.1[1a];[0a][1a]amerge[a]" -map 0:v -map "[a]" -ac 2 -t 0 out.mpg
and this is the error that i get as response :
[Parsed_amerge_4 @ 00000000003a36e0] No channel layout for input 1
[Parsed_amerge_4 @ 00000000003a36e0] Input channel layouts overlap: output layou
t will be determined by the number of distinct input channels
[mpeg @ 000000000289a4e0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer sizein addition i add the full log :
C:\bina\ffmpeg\bin>ffmpeg -i vid.mpg -i
aud.mp3 -c:v copy -filter_complex "[1:a]aform
at = fltp:44100:stereo,apad[0a];[1]aformat=fltp:44100:stereo,volume=0.1[1a];[0a]
[1a]amerge[a]" -map 0:v -map "[a]" -ac 2 -t 0 out.mpg
ffmpeg version N-78949-g6f5048f Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
ble-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable
-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --ena
ble-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx
264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable
-lzma --enable-decklink --enable-zlib
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 27.101 / 57. 27.101
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.100 / 6. 39.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mpeg, from 'vid.mpg':
Duration: 00:00:33.62, start: 0.529978, bitrate: 22407 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 1920x1080 [SAR 1:
1 DAR 16:9], max. 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
[mp3 @ 00000000003e3c20] Skipping 0 bytes of junk at 253.
Input #1, mp3, from 'aud.mp3':
Metadata:
encoder : Lavf57.28.100
Duration: 00:01:03.03, start: 0.025057, bitrate: 128 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Metadata:
encoder : Lavc57.27
File 'out.mpg' already exists. Overwrite
? [y/N] y
[Parsed_amerge_4 @ 00000000003a36e0] No channel layout for input 1
[Parsed_amerge_4 @ 00000000003a36e0] Input channel layouts overlap: output layou
t will be determined by the number of distinct input channels
[mpeg @ 000000000289a4e0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'out.mpg':
Metadata:
encoder : Lavf57.28.100
Stream #0:0: Video: mpeg2video, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-3
1, max. 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1: Audio: mp2, 44100 Hz, stereo, s16, 384 kb/s (default)
Metadata:
encoder : Lavc57.27.101 mp2
Stream mapping:
Stream #1:0 (mp3) -> aformat
Stream #1:0 (mp3) -> aformat
Stream #0:0 -> #0:0 (copy)
amerge -> Stream #0:1 (mp2)
Press [q] to stop, [?] for help
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=234676 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=234676 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=236705 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=236705 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=238746 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=238746 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=240787 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=240787 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=242828 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=242828 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=244869 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=244869 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=246910 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=246910 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=248951 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=248951 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=250992 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=250992 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=253033 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=253033 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=255074 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=255074 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=257115 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=257115 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=259156 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=259156 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=261197 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=261197 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=263238 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=263238 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=265279 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=265279 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=267320 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=267320 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=269361 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=269361 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=271402 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=271402 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=273443 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=273443 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=275484 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=275484 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=277525 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=277525 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=279566 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=279566 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=281607 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=281607 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=283648 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=283648 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=285689 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=285689 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=287730 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=287730 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=289771 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=289771 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=291812 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=291812 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=293853 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=293853 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=295894 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=295894 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=297935 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=297935 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=299976 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=299976 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=302017 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=302017 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=304058 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=304058 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=306099 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=306099 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=308140 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=308140 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=310181 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=310181 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=312222 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=312222 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=314263 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=314263 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=316304 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=316304 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=318345 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=318345 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=320386 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=320386 size=322616
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=322427 size=322616
[mpeg @ 000000000289a4e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 000000000289a4e0] buffer underflow st=0 bufi=322427 size=322616
frame= 1 fps=0.0 q=-1.0 Lsize= 318kB time=00:00:00.00 bitrate=N/A speed=
0x
video:315kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing o
verhead: 0.934858%
C:\bina\ffmpeg\bin>ffmpeg -i vid.mpg -i
aud.mp3 -c:v copy -filter_complex "[0:a]aform
at = fltp:44100:stereo,apad[0a];[1]aformat=fltp:44100:stereo,volume=0.1[1a];[0a]
[1a]amerge[a]" -map 0:v -map "[a]" -ac 2 -t 0 out.mpgwhat am i doing wrong ? and how can i solve it ?
please help.
-
Discord.py repository example : bot can join voice channel, shows voice activity (green ring), but no sound is produced ?
19 juin 2023, par Jared RobertsonI copied an example from the discord.py repository to test out a bot with music capabilities. Though the code enables YouTube playback, I am only concerned with local audio playback. See code here : https://github.com/Rapptz/discord.py/blob/v2.3.0/examples/basic_voice.py. I tested this code as is with only the Discord token portion updated (from constants.py). See code below :


# This example requires the 'message_content' privileged intent to function.

#my constants.py with API keys, tokens, etc. stored
import constants

import asyncio

import discord
import youtube_dl

from discord.ext import commands

# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ''


ytdl_format_options = {
 'format': 'bestaudio/best',
 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
 'restrictfilenames': True,
 'noplaylist': True,
 'nocheckcertificate': True,
 'ignoreerrors': False,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'auto',
 'source_address': '0.0.0.0', # bind to ipv4 since ipv6 addresses cause issues sometimes
}

ffmpeg_options = {
 'options': '-vn',
}

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)


class YTDLSource(discord.PCMVolumeTransformer):
 def __init__(self, source, *, data, volume=0.5):
 super().__init__(source, volume)

 self.data = data

 self.title = data.get('title')
 self.url = data.get('url')

 @classmethod
 async def from_url(cls, url, *, loop=None, stream=False):
 loop = loop or asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))

 if 'entries' in data:
 # take first item from a playlist
 data = data['entries'][0]

 filename = data['url'] if stream else ytdl.prepare_filename(data)
 return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)


class Music(commands.Cog):
 def __init__(self, bot):
 self.bot = bot

 @commands.command()
 async def join(self, ctx, *, channel: discord.VoiceChannel):
 """Joins a voice channel"""

 if ctx.voice_client is not None:
 return await ctx.voice_client.move_to(channel)

 await channel.connect()

 @commands.command()
 async def play(self, ctx, *, query):
 """Plays a file from the local filesystem"""

 source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(query))
 ctx.voice_client.play(source, after=lambda e: print(f'Player error: {e}') if e else None)

 await ctx.send(f'Now playing: {query}')

 @commands.command()
 async def yt(self, ctx, *, url):
 """Plays from a url (almost anything youtube_dl supports)"""

 async with ctx.typing():
 player = await YTDLSource.from_url(url, loop=self.bot.loop)
 ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None)

 await ctx.send(f'Now playing: {player.title}')

 @commands.command()
 async def stream(self, ctx, *, url):
 """Streams from a url (same as yt, but doesn't predownload)"""

 async with ctx.typing():
 player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True)
 ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None)

 await ctx.send(f'Now playing: {player.title}')

 @commands.command()
 async def volume(self, ctx, volume: int):
 """Changes the player's volume"""

 if ctx.voice_client is None:
 return await ctx.send("Not connected to a voice channel.")

 ctx.voice_client.source.volume = volume / 100
 await ctx.send(f"Changed volume to {volume}%")

 @commands.command()
 async def stop(self, ctx):
 """Stops and disconnects the bot from voice"""

 await ctx.voice_client.disconnect()

 @play.before_invoke
 @yt.before_invoke
 @stream.before_invoke
 async def ensure_voice(self, ctx):
 if ctx.voice_client is None:
 if ctx.author.voice:
 await ctx.author.voice.channel.connect()
 else:
 await ctx.send("You are not connected to a voice channel.")
 raise commands.CommandError("Author not connected to a voice channel.")
 elif ctx.voice_client.is_playing():
 ctx.voice_client.stop()


intents = discord.Intents.default()
intents.message_content = True

bot = commands.Bot(
 command_prefix=commands.when_mentioned_or("!"),
 description='Relatively simple music bot example',
 intents=intents,
)


@bot.event
async def on_ready():
 print(f'Logged in as {bot.user} (ID: {bot.user.id})')
 print('------')


async def main():
 async with bot:
 await bot.add_cog(Music(bot))
 #referenced my discord token in constants.py
 await bot.start(constants.discord_token)


asyncio.run(main())



This code should cause the Discord bot to join the voice channel and play a local audio file when the message " !play query" is entered into the Discord text channel, with query in my case being "test.mp3." When " !play test.mp3" is entered, the bot does join the voice channel and appears to generate voice activity, however no sound is heard. No errors are thrown in the output. The bot simply continues on silently.


Here's what I've checked and tried :


- 

-
I am in the Discord voice channel. The code will alert that user is not in the voice channel if a user attempts to summon the bot without being in a voice channel.


-
FFmpeg is installed and added to PATH. I even stored a copy of the .exe in the project folder.


-
I've tried specifying the full path of both FFmpeg (adding the "executable=" arg to the play function) and the audio file (stored at C :/test.mp3 and a copy in the project folder).


-
All libraries up to date.


-
Reviewed discord.py docs (https://discordpy.readthedocs.io/en/stable/api.html#voice-related) and played around with opuslib (docs say not necessary on Windows, which I'm on) and FFmpegOpusAudio, but results were the same.


-
Referenced numerous StackOverflow threads, including every one suggested when I typed the title of this post. Tried each suggestion individually and in various combinations when possible. See a few below :
Discord.py music_cog, bot joins channel but plays no sound
Discord.py Music Bot doesn’t play music
Discord.py Bot Not Playing music


-
Double checked my sound is on and volume turned up. My sound is working I can hear the Discord notification when the bot joins the voice channel.


-
Issue is the same if I try to play a YouTube file with !yt command. Bot joins channel fine but no sound is produced.




















That's everything I can think of at the moment. There seem to be many posts regarding this exact topic and also variations of it. I've been unable to find a clear and consistent answer, nor one the works for me. I am willing to try anything at this point as it is obviously possible, but for whatever reason success eludes me. Thank you in advance for any assistance you are willing to offer.


-