Delicious Cake
Delicious Cake
CC#
Created by Delicious Cake on 5/18/2024 in #help
✅ How to play an MP3 from byte data array instead of writing it to a file and then playing it?
NAudio, sorry
4 replies
CC#
Created by Delicious Cake on 5/18/2024 in #help
✅ ERROR: The calling thread cannot access this object because a different thread owns it.
Amazing, thank you for the help :)
23 replies
CC#
Created by Delicious Cake on 5/18/2024 in #help
✅ ERROR: The calling thread cannot access this object because a different thread owns it.
That worked! Not getting the colour I expected from the username though, that might be cause either converting it wrong or grabbing the wrong value from TwitchLib's OnMessageReceivedArgs
23 replies
CC#
Created by Delicious Cake on 5/18/2024 in #help
✅ ERROR: The calling thread cannot access this object because a different thread owns it.
Like this?
Application.Current.Dispatcher.Invoke(() =>
{
ChatHistoryCollection.Add(new ChatMessage { UsernameColour = new SolidColorBrush(mediaColor), Username = username, Message = message });
});
Application.Current.Dispatcher.Invoke(() =>
{
ChatHistoryCollection.Add(new ChatMessage { UsernameColour = new SolidColorBrush(mediaColor), Username = username, Message = message });
});
23 replies
CC#
Created by Delicious Cake on 5/18/2024 in #help
✅ ERROR: The calling thread cannot access this object because a different thread owns it.
Ah okay I'll give that a go first
23 replies
CC#
Created by Delicious Cake on 5/18/2024 in #help
✅ ERROR: The calling thread cannot access this object because a different thread owns it.
Am I doing something wrong in the MainWindow constructor?
public MainWindow()
{
InitializeComponent();
_synthesizer = new SpeechSynthesizer();
InitializeTwitchClient();
DataContext = this;
}
public MainWindow()
{
InitializeComponent();
_synthesizer = new SpeechSynthesizer();
InitializeTwitchClient();
DataContext = this;
}
23 replies
CC#
Created by Delicious Cake on 5/18/2024 in #help
✅ ERROR: The calling thread cannot access this object because a different thread owns it.
That's an excellent example! Unfortunately it still gives me this error when I try to add the messages :( Line: ChatHistoryCollection.Add(new ChatMessage { UsernameColour= new SolidColorBrush(mediaColor), Username = username, Message = message }); Error: System.NotSupportedException: 'This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread.'
23 replies