2fur
2fur
CC#
Created by 2fur on 9/12/2023 in #help
❔ Cant merge the same audio file twice or more using WaveFileWriter.CreateWaveFile16();
Hello, Im trying to merge the audio files using NAudio, but if they repeat it doesnt cout it. Im currently using this code:
var playlist = new ConcatenatingSampleProvider(audioFileList);
WaveFileWriter.CreateWaveFile16(path + "\\result.wav", playlist);
var playlist = new ConcatenatingSampleProvider(audioFileList);
WaveFileWriter.CreateWaveFile16(path + "\\result.wav", playlist);
For example when Im trying to merge file "audio1" with "audio1" with "audio2" it only gives me something like: "audio1 + audio2" and doesnt have the second audio1 file
2 replies
CC#
Created by 2fur on 8/17/2023 in #help
❔ Trying to use System.drawing.common 6.0.0 on Linux. Why it doesnt work?
hello, I'm using System.Drawing.Common version 6.0.0 because I read that it should support linux. I changed the runtimeconfig.json as recommended on the microsoft website, but it still doesn't work. I tried this solution: learn.microsoft.com/pl-pl/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only And this is what my json looks like:
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0",
"configProperties": {
"System.Drawing.EnableUnixSupport": true
}
}
}
}
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0",
"configProperties": {
"System.Drawing.EnableUnixSupport": true
}
}
}
}
The error I get: The type initializer for 'Gdip' threw an exception. System.Func'1[System.Exception] at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, int32 stride , Int32 format, IntPtr scan0, IntPtr& bitmap) at ProtogenTheBot.commands.com_2.punishment(CommandContext ctx, String options) in D:\Vs projects\ProtogenTheBot\commands\com_2.cs:line 236 System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information. at System.Drawing.LibraryResolver.EnsureRegistered() at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize() at System.Drawing.SafeNativeMethods.Gdip..cctor() Please help me solve the problem. Thank you in advance
14 replies
CC#
Created by 2fur on 3/30/2023 in #help
❔ How to create a subpage by code
Hello, sorry for the dumb question, but its my first attempt to create a website. Is it possible to create/generate from template a subpage? I mean if i have e.g. https://mypage.com/home, i would like to create from it e.g. https://mypage.com/home/user1 / https://mypage.com/home/user2 and so on..
5 replies
CC#
Created by 2fur on 3/3/2023 in #help
❔ How to build ConsoleApp to Linux?
Hello I know there's a way to do it, but I dont know how. I actually working on windows(10) and using the net6.0 and publishing my consoleApp(c#) with ClickOnce, but it gives me only a .exe file. Please help devastated
38 replies
CC#
Created by 2fur on 3/2/2023 in #help
Do something when event fired
Hello Im kinda new with programming stuff etc and i would like to ask how can I call a function by event or do something when its fired cause actually my event skill are very low. If it matters, i'm trying to create a discord bta using dsharpplus, where there are events that i have trouble handling. currently the code I have is the one below, but this one gives me an error: Severity Code Description Project File Row Skip status Error CS1643 Not all paths in code return value in lambda expression of type "AsyncEventHandler<DiscordClient, MessageCreateEventArgs>" MeowBot D:\Vs projects\MeowBot\Program.cs 168 Active and its doesnt give me any log in sonsole
public static int newMessages;
public static void NewMessageFunction<TEventArgs>(AsyncEventHandler<DiscordClient, MessageCreateEventArgs> MessageCreated)
{
MessageCreated += (sender, e) =>
{
Console.WriteLine("+1 message, messages: " + newMessages);
newMessages++;


};
}
public static int newMessages;
public static void NewMessageFunction<TEventArgs>(AsyncEventHandler<DiscordClient, MessageCreateEventArgs> MessageCreated)
{
MessageCreated += (sender, e) =>
{
Console.WriteLine("+1 message, messages: " + newMessages);
newMessages++;


};
}
5 replies
CC#
Created by 2fur on 2/23/2023 in #help
How to read CData from the xml?
Hello, I have this code to read a xml from the web, but I dont know how to get the cdata with it. Can anyone help, please?
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
Console.Write("<" + reader.Name);

while (reader.MoveToNextAttribute())
Console.Write(" " + reader.Name + "='" + reader.Value + "'");
Console.Write(">");
Console.WriteLine(">");
break;
case XmlNodeType.Text:
Console.WriteLine(reader.Value);
break;
case XmlNodeType.EndElement:
Console.Write("</" + reader.Name);
Console.WriteLine(">");
break;
}
}
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
Console.Write("<" + reader.Name);

while (reader.MoveToNextAttribute())
Console.Write(" " + reader.Name + "='" + reader.Value + "'");
Console.Write(">");
Console.WriteLine(">");
break;
case XmlNodeType.Text:
Console.WriteLine(reader.Value);
break;
case XmlNodeType.EndElement:
Console.Write("</" + reader.Name);
Console.WriteLine(">");
break;
}
}
5 replies
CC#
Created by 2fur on 10/10/2022 in #help
zalgo text turning into Chinese characters..
7 replies
CC#
Created by 2fur on 10/2/2022 in #help
How can I start the task by string?
I need something like this, is this possible to do? void Main() { var input = Console.ReadLine(); Task.Run(() => input ); }
14 replies
CC#
Created by 2fur on 9/28/2022 in #help
How can I send int value from 1 program, to another via internet?
Hello. Is there any easy way to connect 2 programs to each other over the internet? I mean, I need to send an int value from one program to another. Please give me some tips or links how to do it in the right way
Hello. Is there any easy way to connect 2 programs to each other over the internet? I mean, I need to send an int value from one program to another. Please give me some tips or links how to do it in the right way
3 replies