나는 C#에서 사운드를 추가하는 방법을 이미 따르지만 사운드를 재생할 수는 없지만 오류는 아닙니다. 어떻게해야합니까?C에서 백그라운드 사운드를 재생하는 방법 #
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Media;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SoundPlayer myPlayer = new SoundPlayer(WindowsFormsApplication2.Properties.Resources.sound1);
myPlayer.PlayLooping();
}
}
}
SoundPlayer는 WAV 파일에서만 작동합니다. WAV 파일을로드하려는 파일이 있습니까? – keyboardP
이미 소리가 전혀 들리지 않는다. – user2187491
@user2187491, ***는 WAV 파일인가? *** 알다시피, WAV 파일 형식입니다. –