मैं ऑडियो नमूने NAudio के माध्यम से निकाले गए हैं, मैं मानकों पता:नेट ऑडियो नमूने खेलने के लिए कैसे सीधे
- चैनलों नमूना प्रति
- बाइट्स,
- sampleRate
कैसे खेलने के लिए .NET api/या अन्य .Net लाइब्रेरी
का उपयोग करके नमूने यहां कोड:
openFileDialog1.ShowDialog();
using (var reader = new Mp3FileReader(openFileDialog1.FileName))
{
var pcmLength = (int)reader.Length;
var _leftBuffer = new byte[pcmLength/2];
var buffer = new byte[pcmLength];
var bytesRead = reader.Read(buffer, 0, pcmLength);
int index = 0;
for (int i = 0; i < bytesRead; i += 4)
{
//extracting only left channel
_leftBuffer[index] = buffer[i];
index++;
_leftBuffer[index] = buffer[i + 1];
index++;
}
// How to play _leftBuffer (Single channel, 2 bytes per sample, 44100 samples per secound)
}
के लिए मेरा जवाब http://stackoverflow.com/questions/1284322/playing-a-wav-file- इन-नेट/20010577 # 20010577 NAudio का उपयोग कर एक फ़ाइल चलाएगा। – Pat