hello
TimonYang-MSFT
thanks
uninstall NAudio?
with best Regards
NazHim
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi all
how to Playing embedded resource mp3 file
using C#
i want to play mp3 file from embedded resource
with best regards
NazHim
hello
TimonYang-MSFT
thanks
uninstall NAudio?
with best Regards
NazHim
What problem are you encountering now? Are you not sure how to read this file or are you encountering an exception?
I added MP3 to Resources, and then used the following code to play it, hoping to give you some ideas.
private void button1_Click(object sender, EventArgs e)
{
byte[] fileByte = Properties.Resources.au1_mp3;
Stream stream = new MemoryStream(fileByte);
var reader = new NAudio.Wave.Mp3FileReader(stream);
var waveOut = new WaveOut();
waveOut.Init(reader);
waveOut.Play();
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.