Answer the question
In order to leave comments, you need to log in
Playing an audio file in a separate device?
using System;
using NAudio.Wave;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
foreach (var dev in DirectSoundOut.Devices)
{
Console.WriteLine($"{dev.Guid} {dev.Description}");
var outputDevice = new DirectSoundOut(dev.Guid);
var audioFile = new AudioFileReader(@"C:\Users\777\Desktop\Sample.wav"); // аудио файл
outputDevice.Init(audioFile);
outputDevice.Play();
Console.ReadKey();
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question